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 --- test/SemaCXX/vtable-instantiation.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/SemaCXX/vtable-instantiation.cc (limited to 'test/SemaCXX/vtable-instantiation.cc') diff --git a/test/SemaCXX/vtable-instantiation.cc b/test/SemaCXX/vtable-instantiation.cc new file mode 100644 index 0000000..5a13d95 --- /dev/null +++ b/test/SemaCXX/vtable-instantiation.cc @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// PR8640 + +template struct C1 { + virtual void c1() { + T1 t1 = 3; // expected-error {{cannot initialize a variable}} + } +}; + +template struct C2 { + void c2() { + new C1(); // expected-note {{in instantiation of member function}} + } +}; + +void f() { + C2 c2; + c2.c2(); // expected-note {{in instantiation of member function}} +} + -- cgit v1.1