From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- test/SemaCXX/conditional-expr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/SemaCXX/conditional-expr.cpp') diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index a80eda4..7595f1d 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -57,6 +57,16 @@ struct Ambig { operator signed char(); // expected-note 2 {{candidate function}} }; +struct Abstract { + virtual ~Abstract() = 0; // expected-note {{unimplemented pure virtual method '~Abstract' in 'Abstract'}} +}; + +struct Derived1: Abstract { +}; + +struct Derived2: Abstract { +}; + void test() { // This function tests C++0x 5.16 @@ -206,6 +216,9 @@ void test() // Note the thing that this does not test: since DR446, various situations // *must* create a separate temporary copy of class objects. This can only // be properly tested at runtime, though. + + const Abstract &a = true ? static_cast(Derived1()) : Derived2(); // expected-error {{allocating an object of abstract class type 'const Abstract'}} + true ? static_cast(Derived1()) : throw 3; // expected-error {{allocating an object of abstract class type 'const Abstract'}} } namespace PR6595 { -- cgit v1.1