Fix this bug:
typedef int f();
struct S {
f *x; // incorrectly assuming this is function decl, leading to failed assertions.
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57598 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 2fae627..e06761f 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -353,7 +353,9 @@
}
bool isFunc = D.isFunctionDeclarator();
- if (!isFunc && D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_typedef) {
+ if (!isFunc &&
+ D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_typedef &&
+ D.getNumTypeObjects() == 0) {
// Check also for this case:
//
// typedef int f();