diff options
author | John McCall <rjmccall@apple.com> | 2010-08-27 19:56:05 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-27 19:56:05 +0000 |
commit | 1ababa63ded36f8ed6a3e55df8e26d9860ab2867 (patch) | |
tree | 05469b2e17dccc2c9b4b4906c472b665ffc42267 /clang/test | |
parent | 9bad2fb378803b34d911c35175803cf1c88386d6 (diff) | |
download | bcm5719-llvm-1ababa63ded36f8ed6a3e55df8e26d9860ab2867.tar.gz bcm5719-llvm-1ababa63ded36f8ed6a3e55df8e26d9860ab2867.zip |
Continue to instantiate sub-statements in a CompoundStmt as long as
we don't see a DeclStmt (failure to instantiate which generally causes
panic).
llvm-svn: 112282
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/member-pointer.cpp | 41 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-clang.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-expr-3.cpp | 10 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-expr-4.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-function-1.cpp | 6 |
5 files changed, 50 insertions, 11 deletions
diff --git a/clang/test/SemaCXX/member-pointer.cpp b/clang/test/SemaCXX/member-pointer.cpp index 83823f69c63..795c0b95efd 100644 --- a/clang/test/SemaCXX/member-pointer.cpp +++ b/clang/test/SemaCXX/member-pointer.cpp @@ -179,13 +179,11 @@ namespace rdar8358512 { // We can't call this with an overload set because we're not allowed // to look into overload sets unless the parameter has some kind of // function type. - template <class F> void bind(F f); // expected-note 6 {{candidate template ignored}} + template <class F> void bind(F f); // expected-note 12 {{candidate template ignored}} template <class F, class T> void bindmem(F (T::*f)()); // expected-note 4 {{candidate template ignored}} template <class F> void bindfn(F (*f)()); // expected-note 4 {{candidate template ignored}} struct A { - void member(); - void nonstat(); void nonstat(int); @@ -234,4 +232,41 @@ namespace rdar8358512 { } }; }; + + template <class T> class B { + void nonstat(); + void nonstat(int); + + void mixed(); + static void mixed(int); + + static void stat(); + static void stat(int); + + // None of these can be diagnosed yet, because the arguments are + // still dependent. + void test0a() { + bind(&nonstat); + bind(&B::nonstat); + + bind(&mixed); + bind(&B::mixed); + + bind(&stat); + bind(&B::stat); + } + + void test0b() { + bind(&nonstat); // expected-error {{no matching function for call}} + bind(&B::nonstat); // expected-error {{no matching function for call}} + + bind(&mixed); // expected-error {{no matching function for call}} + bind(&B::mixed); // expected-error {{no matching function for call}} + + bind(&stat); // expected-error {{no matching function for call}} + bind(&B::stat); // expected-error {{no matching function for call}} + } + }; + + template void B<int>::test0b(); // expected-note {{in instantiation}} } diff --git a/clang/test/SemaTemplate/instantiate-clang.cpp b/clang/test/SemaTemplate/instantiate-clang.cpp index cef2b7090bf..34d68c4e59f 100644 --- a/clang/test/SemaTemplate/instantiate-clang.cpp +++ b/clang/test/SemaTemplate/instantiate-clang.cpp @@ -24,7 +24,7 @@ template<typename T, typename U, int N, int M> struct ShuffleVector0 { void f(T t, U u, double2 a, double2 b) { (void)__builtin_shufflevector(t, u, N, M); // expected-error{{index}} - (void)__builtin_shufflevector(a, b, N, M); + (void)__builtin_shufflevector(a, b, N, M); // expected-error{{index}} (void)__builtin_shufflevector(a, b, 2, 1); } }; diff --git a/clang/test/SemaTemplate/instantiate-expr-3.cpp b/clang/test/SemaTemplate/instantiate-expr-3.cpp index d506b19a7a9..ca88b00300d 100644 --- a/clang/test/SemaTemplate/instantiate-expr-3.cpp +++ b/clang/test/SemaTemplate/instantiate-expr-3.cpp @@ -63,7 +63,11 @@ template struct Conditional0<int, int, int>; template<typename T> struct StatementExpr0 { void f(T t) { - (void)({ if (t) t = t + 17; t + 12;}); // expected-error{{contextually convertible}} + (void)({ + if (t) // expected-error{{contextually convertible}} + t = t + 17; + t + 12; // expected-error{{invalid operands}} + }); } }; @@ -106,8 +110,8 @@ struct VaArg1 { VaList va; __builtin_va_start(va, n); // expected-error{{int}} for (int i = 0; i != n; ++i) - (void)__builtin_va_arg(va, ArgType); - __builtin_va_end(va); + (void)__builtin_va_arg(va, ArgType); // expected-error{{int}} + __builtin_va_end(va); // expected-error{{int}} } }; diff --git a/clang/test/SemaTemplate/instantiate-expr-4.cpp b/clang/test/SemaTemplate/instantiate-expr-4.cpp index 8cd7342e98e..adae1da26aa 100644 --- a/clang/test/SemaTemplate/instantiate-expr-4.cpp +++ b/clang/test/SemaTemplate/instantiate-expr-4.cpp @@ -115,7 +115,7 @@ template<typename T> struct Delete0 { void f(T t) { delete t; // expected-error{{cannot delete}} - ::delete [] t; + ::delete [] t; // expected-error{{cannot delete}} } }; diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp index a293e9a788d..651c02c6cdc 100644 --- a/clang/test/SemaTemplate/instantiate-function-1.cpp +++ b/clang/test/SemaTemplate/instantiate-function-1.cpp @@ -72,7 +72,7 @@ template<typename T, typename U, typename V> struct X6 { if (T x = t) { t = x; } - return v; + return v; // expected-error{{cannot initialize return object of type}} } }; @@ -178,10 +178,10 @@ template<typename T> struct IndirectGoto0 { prior: T prior_label; - prior_label = &&prior; + prior_label = &&prior; // expected-error{{assigning to 'int'}} T later_label; - later_label = &&later; + later_label = &&later; // expected-error{{assigning to 'int'}} later: (void)(1+1); |