summaryrefslogtreecommitdiffstats
path: root/test/CXX/class/class.mem/p8-0x-pedantic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class/class.mem/p8-0x-pedantic.cpp')
-rw-r--r--test/CXX/class/class.mem/p8-0x-pedantic.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CXX/class/class.mem/p8-0x-pedantic.cpp b/test/CXX/class/class.mem/p8-0x-pedantic.cpp
new file mode 100644
index 0000000..a4b775c
--- /dev/null
+++ b/test/CXX/class/class.mem/p8-0x-pedantic.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++0x -pedantic -verify %s
+
+namespace inline_extension {
+ struct Base1 {
+ virtual void f() {}
+ };
+
+ struct B : Base1 {
+ virtual void f() override {} // expected-warning {{'override' keyword only allowed in declarations, allowed as an extension}}
+ virtual void g() final {} // expected-warning {{'final' keyword only allowed in declarations, allowed as an extension}}
+ virtual void h() new {} // expected-warning {{'new' keyword only allowed in declarations, allowed as an extension}}
+ };
+}
+
OpenPOWER on IntegriCloud