summaryrefslogtreecommitdiff
path: root/test/FixIt
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2015-03-24 13:02:50 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2015-03-24 13:02:50 +0000
commit49079d45966a3f57cd82edb35bde2e8e88fccf40 (patch)
treefac218b71ad38edf84bedbd934188fe84f6d4620 /test/FixIt
parent2131e63e2fdff7c831ab3bfe31facf2e3ebab03d (diff)
downloadclang-49079d45966a3f57cd82edb35bde2e8e88fccf40.tar.gz
Diagnose ref-qualifiers occuring after virt-specifier-seq and generate fixit hints
Summary: Follow-up to the fix of PR22075. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7012 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r--test/FixIt/fixit-cxx0x.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp
index 6e096e5e78..5aebcb3def 100644
--- a/test/FixIt/fixit-cxx0x.cpp
+++ b/test/FixIt/fixit-cxx0x.cpp
@@ -159,7 +159,7 @@ namespace MisplacedParameterPack {
void redundantEllipsisInNonTypeTemplateParameter();
}
-namespace MisplacedDeclSpecAfterVirtSpec {
+namespace MisplacedDeclAndRefSpecAfterVirtSpec {
struct B {
virtual void f();
virtual void f() volatile const;
@@ -168,4 +168,12 @@ namespace MisplacedDeclSpecAfterVirtSpec {
virtual void f() override;
virtual void f() override final const volatile; // expected-error {{'const' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'volatile' qualifier may not appear after the virtual specifier 'final'}}
};
+ struct B2 {
+ virtual void f() &;
+ virtual void f() volatile const &&;
+ };
+ struct D2 : B2 {
+ virtual void f() override &; // expected-error {{'&' qualifier may not appear after the virtual specifier 'override'}}
+ virtual void f() override final const volatile &&; // expected-error {{'const' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'volatile' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'&&' qualifier may not appear after the virtual specifier 'final'}}
+ };
}