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

llvm-svn: 233160
This commit is contained in:
Ehsan Akhgari
2015-03-25 00:53:27 +00:00
parent d811ffa5e6
commit 93ed5cf5e6
7 changed files with 75 additions and 3 deletions

View File

@@ -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);