summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentSema.cpp
diff options
context:
space:
mode:
authorMark de Wever <koraq@xs4all.nl>2019-12-10 18:32:29 +0100
committerMark de Wever <koraq@xs4all.nl>2019-12-10 21:16:12 +0100
commitb972f2d05e8b39dd84e586756e7078d79134e2fb (patch)
tree72009be491d0b77bfbd927e58b2d7203cc10c07f /clang/lib/AST/CommentSema.cpp
parent85fff898bb3175693e12536a837c8ad0ec8b2cdd (diff)
downloadbcm5719-llvm-b972f2d05e8b39dd84e586756e7078d79134e2fb.tar.gz
bcm5719-llvm-b972f2d05e8b39dd84e586756e7078d79134e2fb.zip
[Wdocumentation] Properly place deprecated attribute
It is now placed before the function: - allows to replace __attribute__((deprecated)) with [[deprecated]]. - required for trailing returns. Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71140
Diffstat (limited to 'clang/lib/AST/CommentSema.cpp')
-rw-r--r--clang/lib/AST/CommentSema.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index bef555d3ebe..d0c98e6de45 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -701,11 +701,11 @@ void Sema::checkDeprecatedCommand(const BlockCommandComment *Command) {
AttributeSpelling = MacroName;
}
- SmallString<64> TextToInsert(" ");
- TextToInsert += AttributeSpelling;
- Diag(FD->getEndLoc(), diag::note_add_deprecation_attr)
- << FixItHint::CreateInsertion(FD->getEndLoc().getLocWithOffset(1),
- TextToInsert);
+ SmallString<64> TextToInsert = AttributeSpelling;
+ TextToInsert += " ";
+ SourceLocation Loc = FD->getSourceRange().getBegin();
+ Diag(Loc, diag::note_add_deprecation_attr)
+ << FixItHint::CreateInsertion(Loc, TextToInsert);
}
}
OpenPOWER on IntegriCloud