diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-03-12 15:42:38 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-03-12 15:42:38 +0000 |
commit | b060ad870f4e3770e4d5b2ca149c59669f8d56b8 (patch) | |
tree | c91875cc52ef6d383d7a48f6527e0244ea1ceebf /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | bc216b440f02b335a3118266ee07f7e2c1d987cb (diff) | |
download | bcm5719-llvm-b060ad870f4e3770e4d5b2ca149c59669f8d56b8.tar.gz bcm5719-llvm-b060ad870f4e3770e4d5b2ca149c59669f8d56b8.zip |
[clang-format] Don't detect C++11 attribute specifiers as ObjC
Summary:
Previously, clang-format would detect C++11 and C++17 attribute
specifiers like the following as Objective-C method invocations:
[[noreturn]];
[[clang::fallthrough]];
[[noreturn, deprecated("so sorry")]];
[[using gsl: suppress("type")]];
To fix this, I ported part of the logic from
tools/clang/lib/Parse/ParseTentative.cpp into TokenAnnotator.cpp so we
can explicitly parse and identify C++11 attribute specifiers.
This allows the guessLanguage() and getStyle() APIs to correctly
guess files containing the C++11 attribute specifiers as C++,
not Objective-C.
Test Plan: New tests added. Ran tests with:
make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: krasimir, jolesiak, djasper
Reviewed By: djasper
Subscribers: aaron.ballman, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D43902
llvm-svn: 327284
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
0 files changed, 0 insertions, 0 deletions