diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-06 01:31:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-06 01:31:20 +0000 |
commit | 1d7bcf4b35f8bc0a0a40f4ea7b06b55c63725108 (patch) | |
tree | 6e9a01946c637a5af8f99458634b47f504f45fbd /lib/Parse/ParseDecl.cpp | |
parent | a0b2ba1d0ec27240f922c95b5acd8df905e3d3e0 (diff) |
Tweak to r147599 for PR10828: Move the check from the parser into sema, and use
the Semantic Powers to only warn on class types (or dependent types), where the
constructor or destructor could do something interesting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index d3c8211372..ee4a51e184 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1111,21 +1111,6 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS, if (FirstDecl) DeclsInGroup.push_back(FirstDecl); - // In C++, "T var();" at block scope is probably an attempt to initialize a - // variable, not a function declaration. We don't catch this case earlier, - // since there is no ambiguity here. - if (getLang().CPlusPlus && Context != Declarator::FileContext && - D.getNumTypeObjects() == 1 && D.isFunctionDeclarator() && - D.getDeclSpec().getStorageClassSpecAsWritten() - == DeclSpec::SCS_unspecified && - D.getDeclSpec().getTypeSpecType() != DeclSpec::TST_void) { - DeclaratorChunk &C = D.getTypeObject(0); - if (C.Fun.NumArgs == 0 && !C.Fun.isVariadic && !C.Fun.TrailingReturnType && - C.Fun.getExceptionSpecType() == EST_None) - Diag(C.Loc, diag::warn_empty_parens_are_function_decl) - << SourceRange(C.Loc, C.EndLoc); - } - bool ExpectSemi = Context != Declarator::ForContext; // If we don't have a comma, it is either the end of the list (a ';') or an |