From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../temp.variadic/injected-class-name.cpp | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp (limited to 'clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp') diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp new file mode 100644 index 0000000..b5786ac --- /dev/null +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp @@ -0,0 +1,75 @@ +// RUN: %clang_cc1 -std=c++11 -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.2.3