summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2017-02-12 19:08:02 +0000
committerRenato Golin <renato.golin@linaro.org>2017-02-12 19:08:02 +0000
commit510f37cc7dd7e1e8aaa20c01deb002824ea95b5b (patch)
tree840a0b951026b727c494ae49fda88351f6653bfb /clang/lib
parent4b08913de1c10bc22182a9972aeda7092f993b3b (diff)
downloadbcm5719-llvm-510f37cc7dd7e1e8aaa20c01deb002824ea95b5b.tar.gz
bcm5719-llvm-510f37cc7dd7e1e8aaa20c01deb002824ea95b5b.zip
Revert "Attributes on K&R C functions should not cause incompatible..."
...function type with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype." Also Revert "Hopefully fixes a compile error introduced by r294861." This reverts commit r294862, r294861, as they bork the ARM builds and haven't fix it back. Also, please, short commit titles, long commit decsriptions... llvm-svn: 294910
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index bc4611cb067..5f98d4505f1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7564,12 +7564,11 @@ static FunctionDecl* CreateNewFunctionDecl(Sema &SemaRef, Declarator &D,
// Determine whether the function was written with a
// prototype. This true when:
// - there is a prototype in the declarator, or
- // - the type R of the function is some kind of typedef or other non-
- // attributed reference to a type name (which eventually refers to a
- // function type).
+ // - the type R of the function is some kind of typedef or other reference
+ // to a type name (which eventually refers to a function type).
bool HasPrototype =
(D.isFunctionDeclarator() && D.getFunctionTypeInfo().hasPrototype) ||
- (!R->getAsAdjusted<FunctionType>() && R->isFunctionProtoType());
+ (!isa<FunctionType>(R.getTypePtr()) && R->isFunctionProtoType());
NewFD = FunctionDecl::Create(SemaRef.Context, DC,
D.getLocStart(), NameInfo, R,
@@ -12105,7 +12104,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
!LangOpts.CPlusPlus) {
TypeSourceInfo *TI = FD->getTypeSourceInfo();
TypeLoc TL = TI->getTypeLoc();
- FunctionTypeLoc FTL = TL.getAsAdjusted<FunctionTypeLoc>();
+ FunctionTypeLoc FTL = TL.castAs<FunctionTypeLoc>();
Diag(FTL.getLParenLoc(), diag::warn_strict_prototypes) << 1;
}
}
OpenPOWER on IntegriCloud