From 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 20 Feb 2011 13:06:31 +0000 Subject: Vendor import of clang trunk r126079: http://llvm.org/svn/llvm-project/cfe/trunk@126079 --- .../temp.variadic/injected-class-name.cpp | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp (limited to 'test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp') diff --git a/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp b/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp new file mode 100644 index 0000000..a76ef80 --- /dev/null +++ b/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp @@ -0,0 +1,75 @@ +// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s + +// Check for declaration matching with out-of-line declarations and +// variadic templates, which involves proper computation of the +// injected-class-name. +template +struct X0 { + typedef T type; + + void f0(T); + type f1(T); +}; + +template +void X0::f0(T) { } + +template +typename X0::type X0::f1(T) { } + +template +struct X0 { + typedef T* result; + result f3(); + + template + struct Inner; +}; + +template +typename X0::result X0::f3() { return 0; } + +template +template +struct X0::Inner { + template void f4(); +}; + +template +template +template +void X0::Inner::f4() { } + +namespace rdar8848837 { + // Out-of-line definitions that cause rebuilding in the current + // instantiation. + template struct X; + + template + struct X { + X f(); + }; + + template + X X::f() { return *this; } + + + X xif; + + template struct unsigned_c { }; + template int g(ArgTypes...); + + template struct X1; + + template + struct X1 { + unsigned_c f(); + }; + + template + unsigned_c X1::f() { + return unsigned_c(); + } + + X1 xif2; +} -- cgit v1.1