diff options
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/class.access/class.friend/p1.cpp | 2 | ||||
-rw-r--r-- | test/CXX/class.access/p4.cpp | 20 | ||||
-rw-r--r-- | test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp | 15 | ||||
-rw-r--r-- | test/CXX/expr/expr.post/expr.ref/p3.cpp | 15 | ||||
-rw-r--r-- | test/CXX/temp/temp.decls/temp.friend/p4.cpp | 10 | ||||
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp | 3 | ||||
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp | 2 | ||||
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp | 6 | ||||
-rw-r--r-- | test/CXX/temp/temp.names/p2.cpp | 13 | ||||
-rw-r--r-- | test/CXX/temp/temp.spec/temp.explicit/p2.cpp | 4 | ||||
-rw-r--r-- | test/CXX/temp/temp.spec/temp.explicit/p5.cpp | 2 |
11 files changed, 74 insertions, 18 deletions
diff --git a/test/CXX/class.access/class.friend/p1.cpp b/test/CXX/class.access/class.friend/p1.cpp index 991698d..563ae4f 100644 --- a/test/CXX/class.access/class.friend/p1.cpp +++ b/test/CXX/class.access/class.friend/p1.cpp @@ -189,7 +189,7 @@ namespace test4 { struct Inequal {}; bool test() { Holder<Inequal> a, b; - return a == b; // expected-note {{requested here}} + return a == b; // expected-note {{requested here}} } } diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp index 1cd8966..e8afbe7 100644 --- a/test/CXX/class.access/p4.cpp +++ b/test/CXX/class.access/p4.cpp @@ -97,7 +97,7 @@ namespace test2 { A A::foo; // okay class B : A { }; // expected-error {{base class 'test2::A' has private constructor}} - B b; + B b; // expected-note{{implicit default constructor}} class C : virtual A { public: @@ -105,7 +105,7 @@ namespace test2 { }; class D : C { }; // expected-error {{inherited virtual base class 'test2::A' has private constructor}} - D d; + D d; // expected-note{{implicit default constructor}} } // Implicit destructor calls. @@ -143,13 +143,15 @@ namespace test3 { }; class Derived3 : // expected-error 2 {{inherited virtual base class 'Base<2>' has private destructor}} \ - // expected-error 2 {{inherited virtual base class 'Base<3>' has private destructor}} + // expected-error 2 {{inherited virtual base class 'Base<3>' has private destructor}} \ + // expected-note 2{{implicit default constructor}} Base<0>, // expected-error 2 {{base class 'Base<0>' has private destructor}} virtual Base<1>, // expected-error 2 {{base class 'Base<1>' has private destructor}} Base2, // expected-error 2 {{base class 'test3::Base2' has private destructor}} virtual Base3 - {}; - Derived3 d3; + {}; + Derived3 d3; // expected-note {{implicit default constructor}}\ + // expected-note{{implicit default destructor}}} } // Conversion functions. @@ -205,13 +207,13 @@ namespace test5 { class Test1 { A a; }; // expected-error {{private member}} void test1() { Test1 a; - a = Test1(); + a = Test1(); // expected-note{{implicit default copy}} } class Test2 : A {}; // expected-error {{private member}} void test2() { Test2 a; - a = Test2(); + a = Test2(); // expected-note{{implicit default copy}} } } @@ -224,12 +226,12 @@ namespace test6 { class Test1 { A a; }; // expected-error {{field of type 'test6::A' has private copy constructor}} void test1(const Test1 &t) { - Test1 a = t; + Test1 a = t; // expected-note{{implicit default copy}} } class Test2 : A {}; // expected-error {{base class 'test6::A' has private copy constructor}} void test2(const Test2 &t) { - Test2 a = t; + Test2 a = t; // expected-note{{implicit default copy}} } } diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp index fd2df01..4660971 100644 --- a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp +++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8.cpp @@ -81,3 +81,18 @@ namespace test2 { template struct Derived<int>; // expected-note {{in instantiation of template class}} } + +// Redeclarations are okay in a function. +namespace test3 { + namespace N { + int f(int); + typedef int type; + } + + void g() { + using N::f; + using N::f; + using N::type; + using N::type; + } +} diff --git a/test/CXX/expr/expr.post/expr.ref/p3.cpp b/test/CXX/expr/expr.post/expr.ref/p3.cpp new file mode 100644 index 0000000..98771d3 --- /dev/null +++ b/test/CXX/expr/expr.post/expr.ref/p3.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -verify -fsyntax-only %s + +template<typename T> struct Node { + int lhs; + void splay( ) + { + Node<T> n[1]; + (void)n->lhs; + } +}; + +void f() { + Node<int> n; + return n.splay(); +} diff --git a/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/test/CXX/temp/temp.decls/temp.friend/p4.cpp new file mode 100644 index 0000000..226ac0f --- /dev/null +++ b/test/CXX/temp/temp.decls/temp.friend/p4.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template<typename T> +struct X1 { + friend void f6(int) { } // expected-error{{redefinition of}} \ + // expected-note{{previous definition}} +}; + +X1<int> x1a; +X1<float> x1b; // expected-note {{in instantiation of}} diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp index 1b7310f..90d2949 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp @@ -16,7 +16,8 @@ void test_f1(int *ip, float fv) { } // TODO: this diagnostic can and should improve -template<typename T> void f2(T*, T*); // expected-note 2 {{candidate template ignored: failed template argument deduction}} +template<typename T> void f2(T*, T*); // expected-note {{candidate template ignored: failed template argument deduction}} \ +// expected-note{{candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'float')}} struct ConvToIntPtr { operator int*() const; diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp index 6edf079..1b240cc 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s namespace test0 { - template<class T> void apply(T x, void (*f)(T)) { f(x); } // expected-note 2 {{failed template argument deduction}}\ + template<class T> void apply(T x, void (*f)(T)) { f(x); } // expected-note 2 {{candidate template ignored: deduced conflicting types for parameter 'T'}}\ // expected-note {{no overload of 'temp2' matching 'void (*)(int)'}} template<class A> void temp(A); diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp index 2a7f16d..bf5f962 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s template<int i> class A { }; -template<short s> void f(A<s>); // expected-note{{failed template argument deduction}} +template<short s> void f(A<s>); // expected-note{{candidate template ignored: substitution failure}} void k1() { A<1> a; @@ -15,14 +15,14 @@ void k2() { g(b); // OK: cv-qualifiers are ignored on template parameter types } -template<short s> void h(int (&)[s]); // expected-note{{failed template argument deduction}} +template<short s> void h(int (&)[s]); // expected-note{{candidate function template not viable: requires 1 argument, but 2 were provided}} void k3() { int array[5]; h(array); h<5>(array); } -template<short s> void h(int (&)[s], A<s>); // expected-note{{failed template argument deduction}} +template<short s> void h(int (&)[s], A<s>); // expected-note{{candidate template ignored: substitution failure}} void k4() { A<5> a; int array[5]; diff --git a/test/CXX/temp/temp.names/p2.cpp b/test/CXX/temp/temp.names/p2.cpp new file mode 100644 index 0000000..93e45dd --- /dev/null +++ b/test/CXX/temp/temp.names/p2.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// Ensure that when enforcing access control an unqualified template name with +// explicit template arguments, we don't lose the context of the name lookup +// because of the required early lookup to determine if it names a template. +namespace PR7163 { + template <typename R, typename P> void h(R (*func)(P)) {} + class C { + template <typename T> static void g(T*) {}; + public: + void f() { h(g<int>); } + }; +} diff --git a/test/CXX/temp/temp.spec/temp.explicit/p2.cpp b/test/CXX/temp/temp.spec/temp.explicit/p2.cpp index 8538d27..0da316c 100644 --- a/test/CXX/temp/temp.spec/temp.explicit/p2.cpp +++ b/test/CXX/temp/temp.spec/temp.explicit/p2.cpp @@ -39,5 +39,5 @@ namespace N { } using namespace N; -template struct X1<int>; // expected-error{{must occur in}} -template void f1(int); // expected-error{{must occur in}} +template struct X1<int>; // expected-warning{{must occur in}} +template void f1(int); // expected-warning{{must occur in}} diff --git a/test/CXX/temp/temp.spec/temp.explicit/p5.cpp b/test/CXX/temp/temp.spec/temp.explicit/p5.cpp index 13fb049..7522d02 100644 --- a/test/CXX/temp/temp.spec/temp.explicit/p5.cpp +++ b/test/CXX/temp/temp.spec/temp.explicit/p5.cpp @@ -11,7 +11,7 @@ template class Z<int>; // expected-error{{explicit instantiation of non-template // FIXME: This example from the standard is wrong; note posted to CWG reflector // on 10/27/2009 using N::Y; -template class Y<int>; // expected-error{{must occur in}} +template class Y<int>; // expected-warning{{must occur in}} template class N::Y<char*>; template void N::Y<double>::mf(); |