summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/abstract.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaCXX/abstract.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaCXX/abstract.cpp')
-rw-r--r--test/SemaCXX/abstract.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp
index e20a890..d7e2d0a 100644
--- a/test/SemaCXX/abstract.cpp
+++ b/test/SemaCXX/abstract.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wabstract-vbase-init
#ifndef __GXX_EXPERIMENTAL_CXX0X__
#define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
@@ -250,6 +250,13 @@ namespace test4 {
};
}
+namespace test5 {
+ struct A { A(int); virtual ~A() = 0; }; // expected-note {{pure virtual method}}
+ const A &a = 0; // expected-error {{abstract class}}
+ void f(const A &a = 0); // expected-error {{abstract class}}
+ void g() { f(0); } // expected-error {{abstract class}}
+}
+
// PR9247: Crash on invalid in clang::Sema::ActOnFinishCXXMemberSpecification
namespace pr9247 {
struct A {
@@ -273,3 +280,30 @@ namespace pr12658 {
foo(C(99)); // expected-error {{allocating an object of abstract class type 'pr12658::C'}}
}
}
+
+namespace pr16659 {
+ struct A {
+ A(int);
+ virtual void x() = 0; // expected-note {{unimplemented pure virtual method 'x' in 'RedundantInit'}}
+ };
+ struct B : virtual A {};
+ struct C : B {
+ C() : A(37) {}
+ void x() override {}
+ };
+
+ struct X {
+ friend class Z;
+ private:
+ X &operator=(const X&);
+ };
+ struct Y : virtual X { // expected-note {{::X' has an inaccessible copy assignment}}
+ virtual ~Y() = 0;
+ };
+ struct Z : Y {}; // expected-note {{::Y' has a deleted copy assignment}}
+ void f(Z &a, const Z &b) { a = b; } // expected-error {{copy assignment operator is implicitly deleted}}
+
+ struct RedundantInit : virtual A {
+ RedundantInit() : A(0) {} // expected-warning {{initializer for virtual base class 'pr16659::A' of abstract class 'RedundantInit' will never be used}}
+ };
+}
OpenPOWER on IntegriCloud