summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-01-28 06:07:34 +0000
committerNico Weber <nicolasweber@gmx.de>2011-01-28 06:07:34 +0000
commit24b2a822ddb514f468061ac95ffffc7586099ead (patch)
treec7383466228dd84b5c5120ee0bd41cf50547994a /clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp
parentf26870c43d90c7f3fbf976e5cc342bd06acbc09a (diff)
downloadbcm5719-llvm-24b2a822ddb514f468061ac95ffffc7586099ead.tar.gz
bcm5719-llvm-24b2a822ddb514f468061ac95ffffc7586099ead.zip
PR9037: Allow override, final, and new as an extension on inline members.
llvm-svn: 124477
Diffstat (limited to 'clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp')
-rw-r--r--clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp b/clang/test/CXX/class/class.mem/p8-0x-pedantic.cpp
new file mode 100644
index 00000000000..a4b775c191d
--- /dev/null
+++ b/clang/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