diff options
-rw-r--r-- | include/clang/AST/Decl.h | 2 | ||||
-rw-r--r-- | test/CodeGen/typedef-func.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index e3d83af420..1bfad2e391 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -492,7 +492,7 @@ public: unsigned getMinRequiredArguments() const; QualType getResultType() const { - return cast<FunctionType>(getType())->getResultType(); + return getType()->getAsFunctionType()->getResultType(); } StorageClass getStorageClass() const { return StorageClass(SClass); } bool isInline() const { return IsInline; } diff --git a/test/CodeGen/typedef-func.c b/test/CodeGen/typedef-func.c new file mode 100644 index 0000000000..08328e6770 --- /dev/null +++ b/test/CodeGen/typedef-func.c @@ -0,0 +1,13 @@ +// RUN: clang -emit-llvm < %s + +// PR2414 +typedef void filter_func_t(); +filter_func_t mono_filter; + +void addfilter2(filter_func_t *func){} + +void setup_filters() +{ + addfilter2( mono_filter); +} + |