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 | a2be46b72ec868472a83660035af272983fb33ea (patch) | |
tree | 1a068c60dbdbe67cad6b571053942fb49fadc2d9 /lib/Sema/DeclSpec.cpp | |
parent | 1c8a21c701d6cf7b768a9c99974599543a57c9f9 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220215 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 50ed49a3b9..bed94127b2 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -171,6 +171,8 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, SourceLocation ConstQualifierLoc, SourceLocation VolatileQualifierLoc, + SourceLocation + RestrictQualifierLoc, SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, @@ -205,6 +207,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, I.Fun.RefQualifierLoc = RefQualifierLoc.getRawEncoding(); I.Fun.ConstQualifierLoc = ConstQualifierLoc.getRawEncoding(); I.Fun.VolatileQualifierLoc = VolatileQualifierLoc.getRawEncoding(); + I.Fun.RestrictQualifierLoc = RestrictQualifierLoc.getRawEncoding(); I.Fun.MutableLoc = MutableLoc.getRawEncoding(); I.Fun.ExceptionSpecType = ESpecType; I.Fun.ExceptionSpecLoc = ESpecLoc.getRawEncoding(); |