diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-15 04:01:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-15 04:01:16 +0000 |
commit | d60feeb90a4278dfb875fece6587e4c5c1198a60 (patch) | |
tree | 0c5aee3433fd04c9f66197441be98fbc93b51973 | |
parent | 05f9931eefa394698d168dc8e60334180ff6a869 (diff) |
Use of override keywords in C++98 should produce a warning by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142050 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 2 | ||||
-rw-r--r-- | test/Parser/cxx0x-in-cxx98.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 4b2343ddaa..59fc1d6ea8 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -488,7 +488,7 @@ def err_alias_declaration_specialization : Error< "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">; // C++11 override control -def ext_override_control_keyword : Extension< +def ext_override_control_keyword : ExtWarn< "'%0' keyword accepted as a C++11 extension">, InGroup<CXX11>; def err_duplicate_virt_specifier : Error< diff --git a/test/Parser/cxx0x-in-cxx98.cpp b/test/Parser/cxx0x-in-cxx98.cpp index 9e41a700a9..95ceafdfc5 100644 --- a/test/Parser/cxx0x-in-cxx98.cpp +++ b/test/Parser/cxx0x-in-cxx98.cpp @@ -8,3 +8,11 @@ struct X { }; } +struct B { + virtual void f(); + virtual void g(); +}; +struct D final : B { // expected-warning {{'final' keyword accepted as a C++11 extension}} + virtual void f() override; // expected-warning {{'override' keyword accepted as a C++11 extension}} + virtual void g() final; // expected-warning {{'final' keyword accepted as a C++11 extension}} +}; |