summaryrefslogtreecommitdiff
path: root/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2015-03-25 00:53:27 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2015-03-25 00:53:27 +0000
commite68a179790f2c6be2eaa7bf5ba3ff83ec9bc8209 (patch)
tree4c310fbd087e02fe7ccdcfda9d9cd8b4fa3b28b9 /lib/Sema/DeclSpec.cpp
parent5b3910a11fddb28a2f08c87b94f942bb11b8751c (diff)
downloadclang-e68a179790f2c6be2eaa7bf5ba3ff83ec9bc8209.tar.gz
Diagnose declspecs occuring after virt-specifier-seq and generate fixit hints
Summary: This fixes PR22075. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6828 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r--lib/Sema/DeclSpec.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp
index 5e349bc2ad..f6689a96bd 100644
--- a/lib/Sema/DeclSpec.cpp
+++ b/lib/Sema/DeclSpec.cpp
@@ -1220,7 +1220,10 @@ void UnqualifiedId::setOperatorFunctionId(SourceLocation OperatorLoc,
bool VirtSpecifiers::SetSpecifier(Specifier VS, SourceLocation Loc,
const char *&PrevSpec) {
+ if (!FirstLocation.isValid())
+ FirstLocation = Loc;
LastLocation = Loc;
+ LastSpecifier = VS;
if (Specifiers & VS) {
PrevSpec = getSpecifierName(VS);