summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-19 18:14:46 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-19 18:14:46 +0000
commit3729f240af8b0afb2ac5360f951ec9aad0ef4860 (patch)
treea16cfbe04852e02972a6d6743c81d107f3225e59 /clang/lib/Sema/SemaDecl.cpp
parent2050968df96a25a202c00d8e788a57c16e732188 (diff)
downloadbcm5719-llvm-3729f240af8b0afb2ac5360f951ec9aad0ef4860.tar.gz
bcm5719-llvm-3729f240af8b0afb2ac5360f951ec9aad0ef4860.zip
If a function is declared as, e.g.,
F f; where F is a typedef of a function type, then the function "f" has a prototype. This is a slight tweak to Chris's suggested fix in PR3817. Fixes PR3817 and PR3840. llvm-svn: 67313
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 18d55d92f47..a50381123c3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1864,9 +1864,10 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
isVirtualOkay = (SC != FunctionDecl::Static);
} else {
- bool HasPrototype =
+ bool HasPrototype =
getLangOptions().CPlusPlus ||
- (D.getNumTypeObjects() && D.getTypeObject(0).Fun.hasPrototype);
+ (D.getNumTypeObjects() && D.getTypeObject(0).Fun.hasPrototype) ||
+ !isa<FunctionType>(R.getTypePtr());
NewFD = FunctionDecl::Create(Context, DC,
D.getIdentifierLoc(),
OpenPOWER on IntegriCloud