diff options
Diffstat (limited to 'test/SemaTemplate')
25 files changed, 91 insertions, 68 deletions
diff --git a/test/SemaTemplate/class-template-id-2.cpp b/test/SemaTemplate/class-template-id-2.cpp index c492a36..d09f524 100644 --- a/test/SemaTemplate/class-template-id-2.cpp +++ b/test/SemaTemplate/class-template-id-2.cpp @@ -4,7 +4,7 @@ namespace N { template<> class A<int> { }; - template<> class A<float>; // expected-note{{forward declaration of 'class N::A<float>'}} + template<> class A<float>; // expected-note{{forward declaration of 'N::A<float>'}} class B : public A<int> { }; } diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp index efb00c7..c65802e 100644 --- a/test/SemaTemplate/class-template-spec.cpp +++ b/test/SemaTemplate/class-template-spec.cpp @@ -20,7 +20,7 @@ int test_incomplete_specs(A<double, double> *a1, A<double> *a2) { (void)a1->x; // expected-error{{member access into incomplete type}} - (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}} + (void)a2->x; // expected-error{{implicit instantiation of undefined template 'A<double, int>'}} } typedef float FLOAT; diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 3da43fa..d2cc45b 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -11,17 +11,17 @@ template<typename T> void f1(T a, T b = 10) { } // expected-error{{no viable con template<typename T> void f2(T a, T b = T()) { } -template<typename T> void f3(T a, T b = T() + T()); // expected-error{{invalid operands to binary expression ('struct S' and 'struct S')}} +template<typename T> void f3(T a, T b = T() + T()); // expected-error{{invalid operands to binary expression ('S' and 'S')}} void g() { f1(10); - f1(S()); // expected-note{{in instantiation of default function argument expression for 'f1<struct S>' required here}} + f1(S()); // expected-note{{in instantiation of default function argument expression for 'f1<S>' required here}} f2(10); f2(S()); f3(10); - f3(S()); // expected-note{{in instantiation of default function argument expression for 'f3<struct S>' required here}} + f3(S()); // expected-note{{in instantiation of default function argument expression for 'f3<S>' required here}} } template<typename T> struct F { @@ -38,10 +38,10 @@ void g2() { void g3(F<int> f, F<struct S> s) { f.f(); - s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}} + s.f(); // expected-note{{in instantiation of default function argument expression for 'f<S>' required here}} F<int> f2; - F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<struct S>' required here}} + F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<S>' required here}} } template<typename T> struct G { diff --git a/test/SemaTemplate/dependent-base-classes.cpp b/test/SemaTemplate/dependent-base-classes.cpp index 08d4de5..600115b 100644 --- a/test/SemaTemplate/dependent-base-classes.cpp +++ b/test/SemaTemplate/dependent-base-classes.cpp @@ -32,7 +32,7 @@ namespace PR6031 { template <class TT> struct FI2 { - C<typename FI2::type> a; // expected-error{{no type named 'type' in 'struct PR6031::FI2'}} \ + C<typename FI2::type> a; // expected-error{{no type named 'type' in 'FI2<TT>'}} \ // expected-error{{C++ requires a type specifier for all declarations}} }; @@ -58,7 +58,7 @@ namespace PR6031 { class NoDepBase::Nested nested; // expected-error{{'Nested' does not name a tag member in the specified scope}} typedef typename NoDepBase::template MemberTemplate<T>::type type; // expected-error{{'MemberTemplate' following the 'template' keyword does not refer to a template}} \ // FIXME: expected-error{{unqualified-id}} - return NoDepBase::a; // expected-error{{no member named 'a' in 'struct PR6031::NoDepBase'}} + return NoDepBase::a; // expected-error{{no member named 'a' in 'NoDepBase<T>'}} } }; } diff --git a/test/SemaTemplate/ext-vector-type.cpp b/test/SemaTemplate/ext-vector-type.cpp index 0e2debf..3973102 100644 --- a/test/SemaTemplate/ext-vector-type.cpp +++ b/test/SemaTemplate/ext-vector-type.cpp @@ -20,7 +20,7 @@ int test_make2() { template<typename T, unsigned Length> struct make3 { - typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type 'struct s'}} + typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type 's'}} }; struct s {}; diff --git a/test/SemaTemplate/injected-class-name.cpp b/test/SemaTemplate/injected-class-name.cpp index 482eae1..586be18 100644 --- a/test/SemaTemplate/injected-class-name.cpp +++ b/test/SemaTemplate/injected-class-name.cpp @@ -42,3 +42,9 @@ struct X1 { void f0(const X1<T, N>&); // expected-error{{redecl}} }; +namespace pr6326 { + template <class T> class A { + friend class A; + }; + template class A<int>; +} diff --git a/test/SemaTemplate/instantiate-cast.cpp b/test/SemaTemplate/instantiate-cast.cpp index 97d3dc3..9669b20 100644 --- a/test/SemaTemplate/instantiate-cast.cpp +++ b/test/SemaTemplate/instantiate-cast.cpp @@ -23,7 +23,7 @@ struct Constructible { template<typename T, typename U> struct CStyleCast0 { void f(T t) { - (void)((U)t); // expected-error{{C-style cast from 'struct A' to 'int'}} + (void)((U)t); // expected-error{{C-style cast from 'A' to 'int' is not allowed}} } }; @@ -36,7 +36,7 @@ template struct CStyleCast0<A, int>; // expected-note{{instantiation}} template<typename T, typename U> struct StaticCast0 { void f(T t) { - (void)static_cast<U>(t); // expected-error{{static_cast from 'int' to 'struct A' is not allowed}} + (void)static_cast<U>(t); // expected-error{{static_cast from 'int' to 'A' is not allowed}} } }; @@ -89,7 +89,7 @@ template struct ConstCast0<int const *, float *>; // expected-note{{instantiatio template<typename T, typename U> struct FunctionalCast1 { void f(T t) { - (void)U(t); // expected-error{{functional-style cast from 'struct A' to 'int'}} + (void)U(t); // expected-error{{functional-style cast from 'A' to 'int' is not allowed}} } }; diff --git a/test/SemaTemplate/instantiate-complete.cpp b/test/SemaTemplate/instantiate-complete.cpp index 0ae13b9..82cc320 100644 --- a/test/SemaTemplate/instantiate-complete.cpp +++ b/test/SemaTemplate/instantiate-complete.cpp @@ -17,12 +17,12 @@ struct X { X<int> f() { return 0; } struct XField { - X<float(int)> xf; // expected-note{{in instantiation of template class 'struct X<float (int)>' requested here}} + X<float(int)> xf; // expected-note{{in instantiation of template class 'X<float (int)>' requested here}} }; void test_subscript(X<double> *ptr1, X<int(int)> *ptr2, int i) { (void)ptr1[i]; - (void)ptr2[i]; // expected-note{{in instantiation of template class 'struct X<int (int)>' requested here}} + (void)ptr2[i]; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}} } void test_arith(X<signed char> *ptr1, X<unsigned char> *ptr2, @@ -30,13 +30,13 @@ void test_arith(X<signed char> *ptr1, X<unsigned char> *ptr2, (void)(ptr1 + 5); // FIXME: if I drop the ')' after void, below, it still parses (!) (void)(5 + ptr2); - (void)(ptr3 + 5); // expected-note{{in instantiation of template class 'struct X<char (char)>' requested here}} - (void)(5 + ptr4); // expected-note{{in instantiation of template class 'struct X<short (short)>' requested here}} + (void)(ptr3 + 5); // expected-note{{in instantiation of template class 'X<char (char)>' requested here}} + (void)(5 + ptr4); // expected-note{{in instantiation of template class 'X<short (short)>' requested here}} } void test_new() { (void)new X<float>(0); - (void)new X<float(float)>; // expected-note{{in instantiation of template class 'struct X<float (float)>' requested here}} + (void)new X<float(float)>; // expected-note{{in instantiation of template class 'X<float (float)>' requested here}} } void test_memptr(X<long> *p1, long X<long>::*pm1, diff --git a/test/SemaTemplate/instantiate-exception-spec.cpp b/test/SemaTemplate/instantiate-exception-spec.cpp index c418fe1..d4f12df 100644 --- a/test/SemaTemplate/instantiate-exception-spec.cpp +++ b/test/SemaTemplate/instantiate-exception-spec.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // FIXME: the "note" should be down at the call site! -template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'struct Incomplete' is not allowed in exception specification}} \ +template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'Incomplete' is not allowed in exception specification}} \ // expected-note{{instantiation of}} struct Incomplete; // expected-note{{forward}} diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp index 37145b6..7af59fd 100644 --- a/test/SemaTemplate/instantiate-expr-1.cpp +++ b/test/SemaTemplate/instantiate-expr-1.cpp @@ -7,7 +7,7 @@ struct Bitfields { void test_Bitfields(Bitfields<0, 5> *b) { (void)sizeof(Bitfields<10, 5>); - (void)sizeof(Bitfields<0, 1>); // expected-note{{in instantiation of template class 'struct Bitfields<0, 1>' requested here}} + (void)sizeof(Bitfields<0, 1>); // expected-note{{in instantiation of template class 'Bitfields<0, 1>' requested here}} } template<int I, int J> @@ -17,7 +17,7 @@ struct BitfieldPlus { void test_BitfieldPlus() { (void)sizeof(BitfieldPlus<0, 1>); - (void)sizeof(BitfieldPlus<-5, 5>); // expected-note{{in instantiation of template class 'struct BitfieldPlus<-5, 5>' requested here}} + (void)sizeof(BitfieldPlus<-5, 5>); // expected-note{{in instantiation of template class 'BitfieldPlus<-5, 5>' requested here}} } template<int I, int J> @@ -28,8 +28,8 @@ struct BitfieldMinus { void test_BitfieldMinus() { (void)sizeof(BitfieldMinus<5, 1>); - (void)sizeof(BitfieldMinus<0, 1>); // expected-note{{in instantiation of template class 'struct BitfieldMinus<0, 1>' requested here}} - (void)sizeof(BitfieldMinus<5, 5>); // expected-note{{in instantiation of template class 'struct BitfieldMinus<5, 5>' requested here}} + (void)sizeof(BitfieldMinus<0, 1>); // expected-note{{in instantiation of template class 'BitfieldMinus<0, 1>' requested here}} + (void)sizeof(BitfieldMinus<5, 5>); // expected-note{{in instantiation of template class 'BitfieldMinus<5, 5>' requested here}} } template<int I, int J> @@ -40,7 +40,7 @@ struct BitfieldDivide { void test_BitfieldDivide() { (void)sizeof(BitfieldDivide<5, 1>); - (void)sizeof(BitfieldDivide<5, 0>); // expected-note{{in instantiation of template class 'struct BitfieldDivide<5, 0>' requested here}} + (void)sizeof(BitfieldDivide<5, 0>); // expected-note{{in instantiation of template class 'BitfieldDivide<5, 0>' requested here}} } template<typename T, T I, int J> @@ -64,9 +64,9 @@ struct BitfieldNeg2 { void test_BitfieldNeg() { (void)sizeof(BitfieldNeg<-5>); // okay - (void)sizeof(BitfieldNeg<5>); // expected-note{{in instantiation of template class 'struct BitfieldNeg<5>' requested here}} + (void)sizeof(BitfieldNeg<5>); // expected-note{{in instantiation of template class 'BitfieldNeg<5>' requested here}} (void)sizeof(BitfieldNeg2<int, -5>); // okay - (void)sizeof(BitfieldNeg2<int, 5>); // expected-note{{in instantiation of template class 'struct BitfieldNeg2<int, 5>' requested here}} + (void)sizeof(BitfieldNeg2<int, 5>); // expected-note{{in instantiation of template class 'BitfieldNeg2<int, 5>' requested here}} } template<typename T> diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp index c5eb3cc..92915c7 100644 --- a/test/SemaTemplate/instantiate-expr-4.cpp +++ b/test/SemaTemplate/instantiate-expr-4.cpp @@ -153,7 +153,7 @@ struct TypeId0 { if (ptr) return typeid(ptr); else - return typeid(T); // expected-error{{'typeid' of incomplete type 'struct Incomplete'}} + return typeid(T); // expected-error{{'typeid' of incomplete type 'Incomplete'}} } }; diff --git a/test/SemaTemplate/instantiate-field.cpp b/test/SemaTemplate/instantiate-field.cpp index d166e7e..60d4b21 100644 --- a/test/SemaTemplate/instantiate-field.cpp +++ b/test/SemaTemplate/instantiate-field.cpp @@ -20,9 +20,9 @@ void test1(const X<int> *xi) { } void test2(const X<float> *xf) { - (void)xf->x; // expected-note{{in instantiation of template class 'struct X<float>' requested here}} + (void)xf->x; // expected-note{{in instantiation of template class 'X<float>' requested here}} } void test3(const X<int(int)> *xf) { - (void)xf->x; // expected-note{{in instantiation of template class 'struct X<int (int)>' requested here}} + (void)xf->x; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}} } diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp index 144c630..7b4c53c 100644 --- a/test/SemaTemplate/instantiate-function-1.cpp +++ b/test/SemaTemplate/instantiate-function-1.cpp @@ -194,7 +194,7 @@ template struct IndirectGoto0<int>; // expected-note{{instantiation}} template<typename T> struct TryCatch0 { void f() { try { - } catch (T t) { // expected-error{{incomplete type}} \ + } catch (T t) { // expected-warning{{incomplete type}} \ // expected-error{{abstract class}} } catch (...) { } diff --git a/test/SemaTemplate/instantiate-member-class.cpp b/test/SemaTemplate/instantiate-member-class.cpp index 742abcc..5d69b50 100644 --- a/test/SemaTemplate/instantiate-member-class.cpp +++ b/test/SemaTemplate/instantiate-member-class.cpp @@ -28,14 +28,14 @@ void test_instantiation(X<double>::C *x, X<float>::D::F *f) { double &dr = x->foo(); float &fr = e->bar(); - f->foo(); // expected-error{{implicit instantiation of undefined member 'struct X<float>::D::F'}} + f->foo(); // expected-error{{implicit instantiation of undefined member 'X<float>::D::F'}} } X<void>::C *c3; // okay X<void>::D::E *e1; // okay -X<void>::D::E e2; // expected-note{{in instantiation of member class 'struct X<void>::D::E' requested here}} +X<void>::D::E e2; // expected-note{{in instantiation of member class 'X<void>::D::E' requested here}} // Redeclarations. namespace test1 { diff --git a/test/SemaTemplate/instantiate-member-expr.cpp b/test/SemaTemplate/instantiate-member-expr.cpp index 324363c..f3a6067 100644 --- a/test/SemaTemplate/instantiate-member-expr.cpp +++ b/test/SemaTemplate/instantiate-member-expr.cpp @@ -16,14 +16,14 @@ public: template <typename CHECKER> void registerCheck(CHECKER *check) { - Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<struct S<void *> >::push_back' requested here}} + Checkers.push_back(S<void *>()); // expected-note {{in instantiation of member function 'vector<S<void *> >::push_back' requested here}} } }; class RetainReleaseChecker { }; void f(GRExprEngine& Eng) { - Eng.registerCheck(new RetainReleaseChecker); // expected-note {{in instantiation of function template specialization 'GRExprEngine::registerCheck<class RetainReleaseChecker>' requested here}} + Eng.registerCheck(new RetainReleaseChecker); // expected-note {{in instantiation of function template specialization 'GRExprEngine::registerCheck<RetainReleaseChecker>' requested here}} } // PR 5838 @@ -43,7 +43,7 @@ namespace test1 { int a; template<typename T> struct B : A<T> { void f() { - a = 0; // expected-error {{type 'struct test1::O' is not a direct or virtual base of ''B<int>''}} + a = 0; // expected-error {{type 'test1::O' is not a direct or virtual base of ''B<int>''}} } }; }; diff --git a/test/SemaTemplate/instantiate-method.cpp b/test/SemaTemplate/instantiate-method.cpp index a02fe52..357ea26 100644 --- a/test/SemaTemplate/instantiate-method.cpp +++ b/test/SemaTemplate/instantiate-method.cpp @@ -20,7 +20,7 @@ void test(X<int> *xi, int *ip, X<int(int)> *xf) { } void test_bad() { - X<void> xv; // expected-note{{in instantiation of template class 'class X<void>' requested here}} + X<void> xv; // expected-note{{in instantiation of template class 'X<void>' requested here}} } template<typename T, typename U> @@ -36,7 +36,7 @@ void test_ovl(Overloading<int, long> *oil, int i, long l) { } void test_ovl_bad() { - Overloading<float, float> off; // expected-note{{in instantiation of template class 'class Overloading<float, float>' requested here}} + Overloading<float, float> off; // expected-note{{in instantiation of template class 'Overloading<float, float>' requested here}} } template<typename T> diff --git a/test/SemaTemplate/instantiate-static-var.cpp b/test/SemaTemplate/instantiate-static-var.cpp index fda2b9ea..e90ac52 100644 --- a/test/SemaTemplate/instantiate-static-var.cpp +++ b/test/SemaTemplate/instantiate-static-var.cpp @@ -6,7 +6,7 @@ public: }; int array1[X<int, 2>::value == 5? 1 : -1]; -X<int, 0> xi0; // expected-note{{in instantiation of template class 'class X<int, 0>' requested here}} +X<int, 0> xi0; // expected-note{{in instantiation of template class 'X<int, 0>' requested here}} template<typename T> @@ -14,7 +14,7 @@ class Y { static const T value = 0; // expected-error{{'value' can only be initialized if it is a static const integral data member}} }; -Y<float> fy; // expected-note{{in instantiation of template class 'class Y<float>' requested here}} +Y<float> fy; // expected-note{{in instantiation of template class 'Y<float>' requested here}} // out-of-line static member variables diff --git a/test/SemaTemplate/instantiate-typedef.cpp b/test/SemaTemplate/instantiate-typedef.cpp index 977fd08..bb168a1 100644 --- a/test/SemaTemplate/instantiate-typedef.cpp +++ b/test/SemaTemplate/instantiate-typedef.cpp @@ -11,6 +11,6 @@ add_pointer<float>::type test2(int * ptr) { return ptr; // expected-error{{cannot initialize return object of type 'add_pointer<float>::type' (aka 'float *') with an lvalue of type 'int *'}} } -add_pointer<int&>::type // expected-note{{in instantiation of template class 'struct add_pointer<int &>' requested here}} \ -// expected-error {{no type named 'type' in 'struct add_pointer<int &>'}} +add_pointer<int&>::type // expected-note{{in instantiation of template class 'add_pointer<int &>' requested here}} \ +// expected-error {{no type named 'type' in 'add_pointer<int &>'}} test3(); diff --git a/test/SemaTemplate/instantiation-backtrace.cpp b/test/SemaTemplate/instantiation-backtrace.cpp index 93f9a35..21456e9 100644 --- a/test/SemaTemplate/instantiation-backtrace.cpp +++ b/test/SemaTemplate/instantiation-backtrace.cpp @@ -2,7 +2,7 @@ template<typename T> struct A; // expected-note 4{{template is declared here}} template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \ -// expected-error{{implicit instantiation of undefined template 'struct A<X *>'}} +// expected-error{{implicit instantiation of undefined template 'A<X *>'}} template<typename T> struct C : B<T> { } ; // expected-note{{instantiation of template class}} @@ -19,14 +19,14 @@ void f() { typedef struct { } X; void g() { - (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}} + (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'B<X>' requested here}} } template<typename T> -struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'struct A<int>'}} - A<T*> // expected-error{{implicit instantiation of undefined template 'struct A<int *>'}} +struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'A<int>'}} + A<T*> // expected-error{{implicit instantiation of undefined template 'A<int *>'}} { }; void h() { - (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'struct G<int>' requested here}} + (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'G<int>' requested here}} } diff --git a/test/SemaTemplate/metafun-apply.cpp b/test/SemaTemplate/metafun-apply.cpp index bb3c88a..3a7408e 100644 --- a/test/SemaTemplate/metafun-apply.cpp +++ b/test/SemaTemplate/metafun-apply.cpp @@ -22,7 +22,7 @@ struct bogus { template<typename MetaFun, typename T> struct apply1 { - typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'struct add_reference::apply<void>' requested here}} \ + typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'add_reference::apply<void>' requested here}} \ // expected-error{{'apply' following the 'template' keyword does not refer to a template}} }; @@ -32,9 +32,9 @@ apply1<add_reference, int>::type ir = i; apply1<add_reference, float>::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot bind to a value of unrelated type 'int'}} void test() { - apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'struct apply1<struct add_reference, void>' requested here}} + apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'apply1<add_reference, void>' requested here}} - apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'struct apply1<struct bogus, int>' requested here}} + apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'apply1<bogus, int>' requested here}} } diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp index fdfd4e4..9c20f2a 100644 --- a/test/SemaTemplate/temp_arg_nontype.cpp +++ b/test/SemaTemplate/temp_arg_nontype.cpp @@ -16,7 +16,7 @@ enum E { Enumerator = 17 }; A<E> *a5; // expected-error{{template argument for non-type template parameter must be an expression}} template<E Value> struct A1; // expected-note{{template parameter is declared here}} A1<Enumerator> *a6; // okay -A1<17> *a7; // expected-error{{non-type template argument of type 'int' cannot be converted to a value of type 'enum E'}} +A1<17> *a7; // expected-error{{non-type template argument of type 'int' cannot be converted to a value of type 'E'}} const long LongValue = 12345678; A<LongValue> *a8; @@ -32,7 +32,7 @@ public: X(int, int); operator int() const; }; -A<X(17, 42)> *a11; // expected-error{{non-type template argument of type 'class X' must have an integral or enumeration type}} +A<X(17, 42)> *a11; // expected-error{{non-type template argument of type 'X' must have an integral or enumeration type}} float f(float); @@ -59,8 +59,8 @@ volatile X * X_volatile_ptr; template<X const &AnX> struct A4; // expected-note 2{{template parameter is declared here}} X an_X; A4<an_X> *a15_1; // okay -A4<*X_volatile_ptr> *a15_2; // expected-error{{reference binding of non-type template parameter of type 'class X const &' to template argument of type 'class X volatile' ignores qualifiers}} -A4<y> *15_3; // expected-error{{non-type template parameter of reference type 'class X const &' cannot bind to template argument of type 'struct Y'}} \ +A4<*X_volatile_ptr> *a15_2; // expected-error{{reference binding of non-type template parameter of type 'X const &' to template argument of type 'X volatile' ignores qualifiers}} +A4<y> *15_3; // expected-error{{non-type template parameter of reference type 'X const &' cannot bind to template argument of type 'struct Y'}} \ // FIXME: expected-error{{expected unqualified-id}} template<int (&fr)(int)> struct A5; // expected-note 2{{template parameter is declared here}} @@ -83,14 +83,14 @@ struct Z { template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}} A6<&Z::foo> *a17_1; A6<&Z::bar> *a17_2; -A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (struct Z::*)(double)' cannot be converted to a value of type 'int (struct Z::*)(int)'}} +A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (Z::*)(double)' cannot be converted to a value of type 'int (Z::*)(int)'}} template<int Z::*pm> struct A7; // expected-note{{template parameter is declared here}} template<int Z::*pm> struct A7c; A7<&Z::int_member> *a18_1; A7c<&Z::int_member> *a18_2; -A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float struct Z::*' cannot be converted to a value of type 'int struct Z::*'}} +A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float Z::*' cannot be converted to a value of type 'int Z::*'}} A7c<(&Z::int_member)> *a18_3; // expected-error{{non-type template argument cannot be surrounded by parentheses}} template<unsigned char C> struct Overflow; // expected-note{{template parameter is declared here}} diff --git a/test/SemaTemplate/temp_arg_type.cpp b/test/SemaTemplate/temp_arg_type.cpp index a376900..a1db3f8 100644 --- a/test/SemaTemplate/temp_arg_type.cpp +++ b/test/SemaTemplate/temp_arg_type.cpp @@ -14,7 +14,7 @@ A<A<int> > *a6; // [temp.arg.type]p2 void f() { class X { }; - A<X> * a = 0; // expected-error{{template argument uses local type 'class X'}} + A<X> * a = 0; // expected-error{{template argument uses local type 'X'}} } struct { int x; } Unnamed; // expected-note{{unnamed type used in template argument was declared here}} diff --git a/test/SemaTemplate/typename-specifier-4.cpp b/test/SemaTemplate/typename-specifier-4.cpp index 0a6fef7..280a1b4 100644 --- a/test/SemaTemplate/typename-specifier-4.cpp +++ b/test/SemaTemplate/typename-specifier-4.cpp @@ -99,3 +99,20 @@ namespace PR6268 { return Inner<U>(); } } + +namespace PR6463 { + struct B { typedef int type; }; // expected-note 2{{member found by ambiguous name lookup}} + struct C { typedef int type; }; // expected-note 2{{member found by ambiguous name lookup}} + + template<typename T> + struct A : B, C { + type& a(); // expected-error{{found in multiple base classes}} + int x; + }; + + // FIXME: Improve source location info here. + template<typename T> + typename A<T>::type& A<T>::a() { // expected-error{{found in multiple base classes}} + return x; // expected-error{{undeclared identifier}} + } +} diff --git a/test/SemaTemplate/typename-specifier.cpp b/test/SemaTemplate/typename-specifier.cpp index b968ea6..42766a0 100644 --- a/test/SemaTemplate/typename-specifier.cpp +++ b/test/SemaTemplate/typename-specifier.cpp @@ -16,7 +16,7 @@ namespace N { int i; typename N::A::type *ip1 = &i; -typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'struct N::B'}} +typename N::B::type *ip2 = &i; // expected-error{{no type named 'type' in 'N::B'}} typename N::C::type *ip3 = &i; // expected-error{{typename specifier refers to non-type member 'type'}} void test(double d) { @@ -33,8 +33,8 @@ void test(double d) { namespace N { template<typename T> struct X { - typedef typename T::type type; // expected-error {{no type named 'type' in 'struct N::B'}} \ - // expected-error {{no type named 'type' in 'struct B'}} \ + typedef typename T::type type; // expected-error {{no type named 'type' in 'N::B'}} \ + // expected-error {{no type named 'type' in 'B'}} \ // FIXME: location info for error above isn't very good \ // expected-error 2{{typename specifier refers to non-type member 'type'}} \ // expected-error{{type 'int' cannot be used prior to '::' because it has no members}} @@ -42,18 +42,18 @@ namespace N { } N::X<N::A>::type *ip4 = &i; -N::X<N::B>::type *ip5 = &i; // expected-note{{in instantiation of template class 'struct N::X<struct N::B>' requested here}} \ +N::X<N::B>::type *ip5 = &i; // expected-note{{in instantiation of template class 'N::X<N::B>' requested here}} \ // expected-error{{no type named 'type' in}} -N::X<N::C>::type *ip6 = &i; // expected-note{{in instantiation of template class 'struct N::X<struct N::C>' requested here}} \ +N::X<N::C>::type *ip6 = &i; // expected-note{{in instantiation of template class 'N::X<N::C>' requested here}} \ // expected-error{{no type named 'type' in}} -N::X<int>::type fail1; // expected-note{{in instantiation of template class 'struct N::X<int>' requested here}} \ +N::X<int>::type fail1; // expected-note{{in instantiation of template class 'N::X<int>' requested here}} \ // expected-error{{no type named 'type' in}} template<typename T> struct Y { - typedef typename N::X<T>::type *type; // expected-note{{in instantiation of template class 'struct N::X<struct B>' requested here}} \ - // expected-note{{in instantiation of template class 'struct N::X<struct C>' requested here}} + typedef typename N::X<T>::type *type; // expected-note{{in instantiation of template class 'N::X<B>' requested here}} \ + // expected-note{{in instantiation of template class 'N::X<C>' requested here}} }; struct A { @@ -69,7 +69,7 @@ struct C { }; ::Y<A>::type ip7 = &i; -::Y<B>::type ip8 = &i; // expected-note{{in instantiation of template class 'struct Y<struct B>' requested here}} \ +::Y<B>::type ip8 = &i; // expected-note{{in instantiation of template class 'Y<B>' requested here}} \ // expected-error{{no type named 'type' in}} -::Y<C>::type ip9 = &i; // expected-note{{in instantiation of template class 'struct Y<struct C>' requested here}} \ +::Y<C>::type ip9 = &i; // expected-note{{in instantiation of template class 'Y<C>' requested here}} \ // expected-error{{no type named 'type' in}} diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp index 58ac08c..8df808d 100644 --- a/test/SemaTemplate/virtual-member-functions.cpp +++ b/test/SemaTemplate/virtual-member-functions.cpp @@ -14,7 +14,7 @@ template<class T> int A<T>::a(T x) { } void f(A<int> x) { - x.anchor(); // expected-note{{in instantiation of member function 'PR5557::A<int>::anchor' requested here}} + x.anchor(); } template<typename T> @@ -52,4 +52,4 @@ T *HasOutOfLineKey<T>::f(float *fp) { return fp; // expected-error{{cannot initialize return object of type 'int *' with an lvalue of type 'float *'}} } -HasOutOfLineKey<int> out_of_line; // expected-note{{in instantiation of member function 'HasOutOfLineKey<int>::HasOutOfLineKey' requested here}} +HasOutOfLineKey<int> out_of_line; |