diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:23:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-28 21:23:03 +0000 |
commit | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (patch) | |
tree | 9ac2087dfbe8507c56dd39d17cad42836448829f /lib/Parse/ParseDecl.cpp | |
parent | 1de93ee5610e8a97e753c881c574f8d994e71373 (diff) | |
download | src-55e6d896ad333f07bb3b1ba487df214fc268a4ab.tar.gz src-55e6d896ad333f07bb3b1ba487df214fc268a4ab.zip |
Vendor import of clang trunk r321530:vendor/clang/clang-trunk-r321545vendor/clang/clang-trunk-r321530
Notes
Notes:
svn path=/vendor/clang/dist/; revision=327302
svn path=/vendor/clang/clang-trunk-r321545/; revision=327322; tag=vendor/clang/clang-trunk-r321545
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 9fe4309ca124..2a999399fb50 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1548,15 +1548,21 @@ void Parser::DiagnoseMisplacedCXX11Attribute(ParsedAttributesWithRange &Attrs, SourceLocation Loc = Tok.getLocation(); ParseCXX11Attributes(Attrs); CharSourceRange AttrRange(SourceRange(Loc, Attrs.Range.getEnd()), true); - + // FIXME: use err_attributes_misplaced Diag(Loc, diag::err_attributes_not_allowed) << FixItHint::CreateInsertionFromRange(CorrectLocation, AttrRange) << FixItHint::CreateRemoval(AttrRange); } -void Parser::DiagnoseProhibitedAttributes(ParsedAttributesWithRange &attrs) { - Diag(attrs.Range.getBegin(), diag::err_attributes_not_allowed) - << attrs.Range; +void Parser::DiagnoseProhibitedAttributes(ParsedAttributesWithRange &attrs, + const SourceLocation CorrectLocation) { + if (CorrectLocation.isValid()) { + CharSourceRange AttrRange(attrs.Range, true); + Diag(CorrectLocation, diag::err_attributes_misplaced) + << FixItHint::CreateInsertionFromRange(CorrectLocation, AttrRange) + << FixItHint::CreateRemoval(AttrRange); + } else + Diag(attrs.Range.getBegin(), diag::err_attributes_not_allowed) << attrs.Range; } void Parser::ProhibitCXX11Attributes(ParsedAttributesWithRange &Attrs, |