Lines Matching defs:int
4 int nonconst = 8; // expected-note 3 {{here}}
6 template<int = nonconst> struct NonConstT {}; // expected-error {{non-type template argument is not a constant expression}} expected-note {{read of non-const}}
18 bool a(int n) {
35 struct S { constexpr operator int() const { return 5; } };
47 int b(unsigned n) {
51 case (int)EE::EE32:
53 case (long long)1e10: // expected-error {{case value evaluates to 10000000000, which cannot be narrowed to type 'unsigned int'}}
54 case -3: // expected-error {{case value evaluates to -3, which cannot be narrowed to type 'unsigned int'}}
62 c = (int)EE::EE32,
67 template<unsigned char> using A = int;
68 using Int = A<E6>;
69 using Int = A<EE::EE32>; // expected-error {{not implicitly convertible}}
70 using Int = A<(int)EE::EE32>;
71 using Int = A<200>;
72 using Int = A<1000>; // expected-error {{template argument evaluates to 1000, which cannot be narrowed to type 'unsigned char'}}
73 using Int = A<-3>; // expected-error {{template argument evaluates to -3, which cannot be narrowed to type 'unsigned char'}}
84 using Int = A<1.0>; // expected-error {{conversion from 'double' to 'unsigned char' is not allowed in a converted constant expression}}
86 True = &a, // expected-error {{conversion from 'bool (*)(int)' to 'bool' is not allowed in a converted constant expression}}
90 // Note, promoted type of switch is 'int'.
92 case 0.0f: // expected-error {{conversion from 'float' to 'int' is not allowed in a converted constant expression}}
96 template <bool B> int f() { return B; } // expected-note {{candidate template ignored: invalid explicitly-specified argument for template parameter 'B'}}
97 template int f<&S::operator int>(); // expected-error {{does not refer to a function template}}
98 template int f<(bool)&S::operator int>();
100 int n = Val<bool, &S::operator int>::value; // expected-error-re {{conversion from 'int (S::*)(){{( __attribute__\(\(thiscall\)\))?}} const' to 'bool' is not allowed in a converted constant expression}}
104 constexpr operator int() const { return 10; }