diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-19 04:08:53 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-19 04:08:53 +0000 |
commit | 2c092257ce69ee7207ae1733f11b2a2275c42e3f (patch) | |
tree | a18202483a9a9593775461414785ebfc00917546 /test/PCH/cxx1z-using-declaration.cpp | |
parent | 7d69588d61629cde4c0c605cbf42bdb975974952 (diff) | |
download | clang-2c092257ce69ee7207ae1733f11b2a2275c42e3f.tar.gz |
[c++1z] P0195R2: Support pack-expansion of using-declarations.
This change introduces UsingPackDecl as a marker for the set of UsingDecls
produced by pack expansion of a single (unresolved) using declaration. This is
not strictly necessary (we just need to be able to map from the original using
declaration to its expansions somehow), but it's useful to maintain the
invariant that each declaration reference instantiates to refer to one
declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH/cxx1z-using-declaration.cpp')
-rw-r--r-- | test/PCH/cxx1z-using-declaration.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/PCH/cxx1z-using-declaration.cpp b/test/PCH/cxx1z-using-declaration.cpp new file mode 100644 index 0000000000..a185ff1740 --- /dev/null +++ b/test/PCH/cxx1z-using-declaration.cpp @@ -0,0 +1,35 @@ +// No PCH: +// RUN: %clang_cc1 -pedantic -std=c++1z -include %s -verify %s +// +// With PCH: +// RUN: %clang_cc1 -pedantic -std=c++1z -emit-pch %s -o %t +// RUN: %clang_cc1 -pedantic -std=c++1z -include-pch %t -verify %s + +#ifndef HEADER +#define HEADER + +template<typename ...T> struct A : T... { + using T::f ...; + template<typename ...U> void g(U ...u) { f(u...); } +}; + +struct X { void f(); }; +struct Y { void f(int); }; +struct Z { void f(int, int); }; + +inline A<X, Y, Z> a; + +#else + +void test() { + a.g(); + a.g(0); + a.g(0, 0); + // expected-error@13 {{no match}} + // expected-note@16 {{candidate}} + // expected-note@17 {{candidate}} + // expected-note@18 {{candidate}} + a.g(0, 0, 0); // expected-note {{instantiation of}} +} + +#endif |