diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2021-05-31 16:18:30 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2021-06-01 08:47:50 -0400 |
commit | 97d234935f1514af128277943f30efc469525371 (patch) | |
tree | e4700e295a24e4a8241905d3de55941c7cef8bf7 /clang/lib/Parse/ParseDecl.cpp | |
parent | 94b0aec0f5c6b4f6a27cf3a542f795bbba72e851 (diff) | |
download | llvm-97d234935f1514af128277943f30efc469525371.zip llvm-97d234935f1514af128277943f30efc469525371.tar.gz llvm-97d234935f1514af128277943f30efc469525371.tar.bz2 |
[clang][Parse] Add parsing support for C++ attributes on using-declarations
This is a re-application of dc67299 which was reverted in f63adf5b because
it broke the build. The issue should now be fixed.
Attribution note: The original author of this patch is Erik Pilkington.
I'm only trying to land it after rebasing.
Differential Revision: https://reviews.llvm.org/D91630
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index fda4275..76d031b 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1650,6 +1650,13 @@ void Parser::ProhibitCXX11Attributes(ParsedAttributesWithRange &Attrs, } } +void Parser::DiagnoseCXX11AttributeExtension(ParsedAttributesWithRange &Attrs) { + for (const ParsedAttr &PA : Attrs) { + if (PA.isCXX11Attribute() || PA.isC2xAttribute()) + Diag(PA.getLoc(), diag::ext_cxx11_attr_placement) << PA << PA.getRange(); + } +} + // Usually, `__attribute__((attrib)) class Foo {} var` means that attribute // applies to var, not the type Foo. // As an exception to the rule, __declspec(align(...)) before the |