diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-10-20 17:32:04 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-10-20 17:32:04 +0000 |
commit | 23a0739161db5ddf398461c9e3293ce7bdd606bf (patch) | |
tree | 602ebde3c9e8e7a56525a49a8bb47a71b75a5852 /clang/lib/Parse/ParseDecl.cpp | |
parent | 52ca678d7464cf6d85393794558297411d7eeaf0 (diff) | |
download | bcm5719-llvm-23a0739161db5ddf398461c9e3293ce7bdd606bf.tar.gz bcm5719-llvm-23a0739161db5ddf398461c9e3293ce7bdd606bf.zip |
Add RestrictQualifierLoc to DeclaratorChunk::FunctionTypeInfo
Clang supports __restrict__ as a function qualifier, but
DeclaratorChunk::FunctionTypeInfo lacked a field to track the qualifier's
source location (as we do with volatile, etc.). This was the subject of a FIXME
in GetFullTypeForDeclarator (in SemaType.cpp). This should also prove useful as
we add more warnings regarding questionable uses of the restrict qualifier.
There is no significant functional change (except for an improved source range
associated with the err_invalid_qualified_function_type diagnostic fixit
generated by GetFullTypeForDeclarator).
llvm-svn: 220215
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index b05af8fa760..4d955548f78 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5120,6 +5120,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, SourceLocation RefQualifierLoc; SourceLocation ConstQualifierLoc; SourceLocation VolatileQualifierLoc; + SourceLocation RestrictQualifierLoc; ExceptionSpecificationType ESpecType = EST_None; SourceRange ESpecRange; SmallVector<ParsedType, 2> DynamicExceptions; @@ -5173,6 +5174,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, EndLoc = DS.getSourceRange().getEnd(); ConstQualifierLoc = DS.getConstSpecLoc(); VolatileQualifierLoc = DS.getVolatileSpecLoc(); + RestrictQualifierLoc = DS.getRestrictSpecLoc(); } // Parse ref-qualifier[opt]. @@ -5245,6 +5247,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, RefQualifierIsLValueRef, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, + RestrictQualifierLoc, /*MutableLoc=*/SourceLocation(), ESpecType, ESpecRange.getBegin(), DynamicExceptions.data(), |