diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-23 18:51:59 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-23 18:51:59 +0000 |
commit | e71b378dc7c0fa9e43532d33827b876008126b10 (patch) | |
tree | a84e23c2d88461dceda4adba39e1528e119ab4c4 /clang/lib/Parse/ParseDecl.cpp | |
parent | 4995b05f56a0993f03f57536129a44d33971dd95 (diff) | |
download | bcm5719-llvm-e71b378dc7c0fa9e43532d33827b876008126b10.tar.gz bcm5719-llvm-e71b378dc7c0fa9e43532d33827b876008126b10.zip |
Fix the behavior of -Wignored-qualifiers on return type qualifiers in
several ways. We now warn for more of the return types, and correctly
locate the ignored ones. Also adds fix-it hints to remove the ignored
qualifiers. Fixes much of PR9058, although not all of it.
Patch by Hans Wennborg, a couple of minor style tweaks from me.
llvm-svn: 126321
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5828bfa114c..60c3a4c262b 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2762,6 +2762,9 @@ void Parser::ParseDeclaratorInternal(Declarator &D, if (Kind == tok::star) // Remember that we parsed a pointer type, and remember the type-quals. D.AddTypeInfo(DeclaratorChunk::getPointer(DS.getTypeQualifiers(), Loc, + DS.getConstSpecLoc(), + DS.getVolatileSpecLoc(), + DS.getRestrictSpecLoc(), DS.takeAttributes()), SourceLocation()); else @@ -3758,4 +3761,3 @@ bool Parser::TryAltiVecTokenOutOfLine(DeclSpec &DS, SourceLocation Loc, } return false; } - |