From c1fc3ec87807a35e2e12bb41a079b10c9db1350a Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 1 Jul 2009 19:21:19 +0000 Subject: Patch to implement template types in ctor-initializer list. Also has fix for bugzilla-4469. llvm-svn: 74631 --- .../class-template-ctor-initializer.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 clang/test/SemaTemplate/class-template-ctor-initializer.cpp (limited to 'clang/test/SemaTemplate/class-template-ctor-initializer.cpp') diff --git a/clang/test/SemaTemplate/class-template-ctor-initializer.cpp b/clang/test/SemaTemplate/class-template-ctor-initializer.cpp new file mode 100644 index 00000000000..d7649f52688 --- /dev/null +++ b/clang/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.2.3