diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-11-29 09:09:06 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-11-29 09:09:06 +0000 |
commit | 53711607a080d75a6a2276bba9322243b445789d (patch) | |
tree | 203a7fbe9e890a5ac229f34d410023d4c48d7a48 /clang/lib/Parse/ParseTemplate.cpp | |
parent | 004685bdf7bd8b9e58b7d7864a87696ccc9ca5ac (diff) | |
download | bcm5719-llvm-53711607a080d75a6a2276bba9322243b445789d.tar.gz bcm5719-llvm-53711607a080d75a6a2276bba9322243b445789d.zip |
Add fix-it to remove 'typedef' from function template definitions. Such a token
was probably meant to be 'typename', which we will have already suggested if it
is appropriate.
llvm-svn: 145395
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 91cf8e81c2a..7b09f8191d2 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -276,9 +276,11 @@ Parser::ParseSingleDeclarationAfterTemplate( if (DeclaratorInfo.isFunctionDeclarator() && isStartOfFunctionDefinition(DeclaratorInfo)) { if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) { - Diag(Tok, diag::err_function_declared_typedef); - - // Recover by ignoring the 'typedef'. + // Recover by ignoring the 'typedef'. This was probably supposed to be + // the 'typename' keyword, which we should have already suggested adding + // if it's appropriate. + Diag(DS.getStorageClassSpecLoc(), diag::err_function_declared_typedef) + << FixItHint::CreateRemoval(DS.getStorageClassSpecLoc()); DS.ClearStorageClassSpecs(); } return ParseFunctionDefinition(DeclaratorInfo, TemplateInfo); |