diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2015-03-25 00:53:27 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2015-03-25 00:53:27 +0000 |
commit | e68a179790f2c6be2eaa7bf5ba3ff83ec9bc8209 (patch) | |
tree | 4c310fbd087e02fe7ccdcfda9d9cd8b4fa3b28b9 /lib/Sema/DeclSpec.cpp | |
parent | 5b3910a11fddb28a2f08c87b94f942bb11b8751c (diff) | |
download | clang-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.cpp | 3 |
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); |