diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
commit | d7279c4c177bca357ef96ff1379fd9bc420bfe83 (patch) | |
tree | 3558f327a6f9ab59c5d7a06528d84e1560445247 /test/CXX/temp | |
parent | be17651f5cd2e94922c1b732bc8589e180698193 (diff) | |
download | src-d7279c4c177bca357ef96ff1379fd9bc420bfe83.tar.gz src-d7279c4c177bca357ef96ff1379fd9bc420bfe83.zip |
Update clang to r104832.vendor/clang/clang-r104832
Notes
Notes:
svn path=/vendor/clang/dist/; revision=208600
svn path=/vendor/clang/clang-r104832/; revision=208977; tag=vendor/clang/clang-r104832
Diffstat (limited to 'test/CXX/temp')
7 files changed, 32 insertions, 8 deletions
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 000000000000..226ac0fc622f --- /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 1b7310f00055..90d29497f4b2 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 6edf079b3524..1b240cc98fc7 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 2a7f16dc6b69..bf5f96225dad 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 000000000000..93e45dd7e3b0 --- /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 8538d27f09bc..0da316cc9cef 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 13fb0492f1a4..7522d02ffa19 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(); |