aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-14 22:11:44 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-14 22:11:44 +0000
commit723df245307a530da5433dfb43accf187dc3e243 (patch)
tree54bc41314c4898d2d1f156fbf627a159eb38e56d /lib/Sema/SemaDecl.cpp
parent8786da77984e81d48e0e1b2bd339809b1efc19f3 (diff)
Added missing IgnoreParens().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 66e517008c..3506456eb7 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3761,7 +3761,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// Copy the parameter declarations from the declarator D to the function
// declaration NewFD, if they are available. First scavenge them into Params.
llvm::SmallVector<ParmVarDecl*, 16> Params;
- if (D.getNumTypeObjects() > 0) {
+ if (D.isFunctionDeclarator()) {
DeclaratorChunk::FunctionTypeInfo &FTI = D.getFunctionTypeInfo();
// Check for C99 6.7.5.3p10 - foo(void) is a non-varargs
@@ -4283,7 +4283,7 @@ void Sema::CheckMain(FunctionDecl* FD) {
if (!Context.hasSameUnqualifiedType(FT->getResultType(), Context.IntTy)) {
TypeSourceInfo *TSI = FD->getTypeSourceInfo();
- TypeLoc TL = TSI->getTypeLoc();
+ TypeLoc TL = TSI->getTypeLoc().IgnoreParens();
const SemaDiagnosticBuilder& D = Diag(FD->getTypeSpecStartLoc(),
diag::err_main_returns_nonint);
if (FunctionTypeLoc* PTL = dyn_cast<FunctionTypeLoc>(&TL)) {