diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-19 23:47:15 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-19 23:47:15 +0000 |
commit | 053214013990ad8ec096dafc64aa7c0ad2b05bc0 (patch) | |
tree | 780636c1e0577c4aa63aa31e832b8f8324079cb4 /test/FixIt | |
parent | 65f991ccbec43b4a860f70594c92528ee8fb7c6f (diff) |
PR15300: Support C++11 attributes on base-specifiers. We don't support any such
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r-- | test/FixIt/fixit-cxx11-attributes.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/FixIt/fixit-cxx11-attributes.cpp b/test/FixIt/fixit-cxx11-attributes.cpp index 7c8efcb8ec..f28bdfc7cd 100644 --- a/test/FixIt/fixit-cxx11-attributes.cpp +++ b/test/FixIt/fixit-cxx11-attributes.cpp @@ -32,3 +32,20 @@ namespace ClassSpecifier { // CHECK: fix-it:{{.*}}:{27:19-27:19} // CHECK: fix-it:{{.*}}:{29:5-29:31} } + +namespace BaseSpecifier { + struct base1 {}; + struct base2 {}; + class with_base_spec : public [[a]] // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:26-[[@LINE-1]]:26}:"[{{\[}}a]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:33-[[@LINE-2]]:39}:"" + virtual [[b]] base1, // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:26-[[@LINE-4]]:26}:"[{{\[}}b]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:34-[[@LINE-2]]:40}:"" + virtual [[c]] // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:26-[[@LINE-1]]:26}:"[{{\[}}c]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:34-[[@LINE-2]]:40}:"" + public [[d]] base2 {}; // expected-error {{an attribute list cannot appear here}} expected-warning {{unknown}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:26-[[@LINE-4]]:26}:"[{{\[}}d]]" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:33-[[@LINE-2]]:39}:"" +} |