diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-25 02:28:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-25 02:28:38 +0000 |
commit | 1ab0d90af489b5441d0bf25338d420ddae3ece74 (patch) | |
tree | 85779f0a1deed884c83838a0a23d182c7e92252f /lib/Sema/DeclSpec.cpp | |
parent | df7b091c58ccdb402a32bfbde9c506074dba5f3d (diff) |
Fix a couple more issues related to r133854:
When performing semantic analysis on a member declaration, fix the check for whether we are declaring a function to check for parenthesized declarators, declaration via decltype, etc.
Also fix the semantic check to not treat FuncType* as a function type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r-- | lib/Sema/DeclSpec.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index d450a32e77..c5b883e46d 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -216,8 +216,22 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, } bool Declarator::isDeclarationOfFunction() const { - if (isFunctionDeclarator()) - return true; + for (unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) { + switch (DeclTypeInfo[i].Kind) { + case DeclaratorChunk::Function: + return true; + case DeclaratorChunk::Paren: + continue; + case DeclaratorChunk::Pointer: + case DeclaratorChunk::Reference: + case DeclaratorChunk::Array: + case DeclaratorChunk::BlockPointer: + case DeclaratorChunk::MemberPointer: + return false; + } + llvm_unreachable("Invalid type chunk"); + return false; + } switch (DS.getTypeSpecType()) { case TST_auto: |