diff options
author | Anders Carlsson <andersca@mac.com> | 2009-03-23 17:49:10 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-03-23 17:49:10 +0000 |
commit | 0d5ca29b7836d55a3a73f83d7e36b4bd35f8d85f (patch) | |
tree | ce963ce70ddff4d1226de8d14643fe5e9c8ba5f0 /clang/test | |
parent | 893c2c963a5db7abddfa4b37e9d69f89131aafbd (diff) | |
download | bcm5719-llvm-0d5ca29b7836d55a3a73f83d7e36b4bd35f8d85f.tar.gz bcm5719-llvm-0d5ca29b7836d55a3a73f83d7e36b4bd35f8d85f.zip |
It's an error to try to allocate an abstract object using new.
llvm-svn: 67542
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/abstract.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/abstract.cpp b/clang/test/SemaCXX/abstract.cpp index e3c7651efb0..1b6099ae7a5 100644 --- a/clang/test/SemaCXX/abstract.cpp +++ b/clang/test/SemaCXX/abstract.cpp @@ -25,6 +25,8 @@ class E : D { static_assert(!__is_abstract(E), "E inherits from an abstract class but implements f"); +C *d = new C; // expected-error {{allocation of an object of abstract type 'C'}} + C c; // expected-error {{variable type 'C' is an abstract class}} void t1(C c); // expected-error {{parameter type 'C' is an abstract class}} void t2(C); // expected-error {{parameter type 'C' is an abstract class}} @@ -32,3 +34,4 @@ void t2(C); // expected-error {{parameter type 'C' is an abstract class}} struct S { C c; // expected-error {{field type 'C' is an abstract class}} }; + |