summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-07-16 01:59:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-07-16 01:59:26 +0000
commitaa488ea287c219565b5169d50142947d1b63a6ca (patch)
treec8af9dadddde2ae0cc9c13cb0c179b38739b8ee6 /test
parent7e54fb5fcc7d7b8e843501652cf7c19cea6c4c57 (diff)
downloadclang-aa488ea287c219565b5169d50142947d1b63a6ca.tar.gz
More for PR11848: a pack expansion type isn't necessarily type-dependent (its
pattern might be an alias template which doesn't use its arguments). It's always instantiation-dependent, though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaTemplate/alias-templates.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/SemaTemplate/alias-templates.cpp b/test/SemaTemplate/alias-templates.cpp
index a3d66ae63b..20ba6e0cb7 100644
--- a/test/SemaTemplate/alias-templates.cpp
+++ b/test/SemaTemplate/alias-templates.cpp
@@ -125,17 +125,17 @@ namespace Core22036 {
void h(...);
template<typename T> using Y = X;
template<typename T, typename ...Ts> struct S {
+ // An expression can contain an unexpanded pack without being type or
+ // value dependent. This is true even if the expression's type is a pack
+ // expansion type.
void f1(Y<T> a) { h(g(a)); } // expected-error {{undeclared identifier 'g'}}
- // FIXME: We should reject this too: 'as' has non-dependent type 'X', so
- // ADL should be performed at the point of definition of the
- // template.
- void f2(Y<Ts>...as) { h(g(as)...); }
+ void f2(Y<Ts>...as) { h(g(as)...); } // expected-error {{undeclared identifier 'g'}}
+ void f3(Y<Ts>...as) { g(as...); } // ok
+ void f4(Ts ...ts) { h(g(sizeof(ts))...); } // expected-error {{undeclared identifier 'g'}}
+ // FIXME: We can reject this, since it has no valid instantiations because
+ // 'g' never has any associated namespaces.
+ void f5(Ts ...ts) { g(sizeof(ts)...); } // ok
};
- int g(X);
- void test() {
- S<int, int>().f1({});
- S<int, int>().f2({});
- }
}
namespace PR13243 {