From 4981926bf654fe5a2c3893f24ca44106b217e71e Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 4 Jul 2009 13:58:54 +0000 Subject: Import Clang r74788. --- .../class-template-ctor-initializer.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/SemaTemplate/class-template-ctor-initializer.cpp (limited to 'test/SemaTemplate/class-template-ctor-initializer.cpp') diff --git a/test/SemaTemplate/class-template-ctor-initializer.cpp b/test/SemaTemplate/class-template-ctor-initializer.cpp new file mode 100644 index 0000000..d7649f52 --- /dev/null +++ b/test/SemaTemplate/class-template-ctor-initializer.cpp @@ -0,0 +1,33 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +template struct A {}; + +template struct B : A { + B() : A() {} +}; +B x; + +template struct B1 : A { + typedef A Base; + B1() : Base() {} +}; +B1 x1; + + +template struct Tmpl { }; + +template struct TmplB { }; + +struct TmplC : Tmpl { + TmplC() : + Tmpl(), + TmplB() { } // expected-error {{type 'TmplB' is not a direct or virtual base of 'TmplC'}} +}; + + +struct TmplD : Tmpl, TmplB { + TmplD(): + Tmpl(), // expected-error {{type 'Tmpl' is not a direct or virtual base of 'TmplD'}} + TmplB() {} +}; + -- cgit v1.1