diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-06 02:30:50 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-06 02:30:50 +0000 |
commit | 2f0e88a87cea6d21429d9f5c0b1c53f24caf77cf (patch) | |
tree | 9efd71d232f39957e0fbcd837097bb3d9ef69bce /lib/Sema/SemaDecl.cpp | |
parent | e0e7c99410f24777f7b10d6c651a262b93c4a8b3 (diff) |
David Blaikie and Chandler would like us to diagnose
int f();
in function scopes under -Wvexing-parse, so now we do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 3e9e66d55d..fecfce4d2d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4914,8 +4914,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, == DeclSpec::SCS_unspecified) { QualType T = R->getAs<FunctionType>()->getResultType(); DeclaratorChunk &C = D.getTypeObject(0); - if ((T->isDependentType() || T->isRecordType()) && - C.Fun.NumArgs == 0 && !C.Fun.isVariadic && + if (!T->isVoidType() && 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) |