summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-18 22:40:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-18 22:40:04 +0000
commit4903c87386ad1fad7e63c49e9a8a0b3e3bbbd884 (patch)
tree8bb47c2208b18047c295ad9935fe6732e6188554 /clang/lib/Sema
parentefb0d6bf1a57fc9ec27fca8a54f524f92e706862 (diff)
downloadbcm5719-llvm-4903c87386ad1fad7e63c49e9a8a0b3e3bbbd884.tar.gz
bcm5719-llvm-4903c87386ad1fad7e63c49e9a8a0b3e3bbbd884.zip
The attached patch is a follow up from my previous one. The existing
logic was not handling typedefs as free functions. This was not causing problems with the existing tests, but does with the microsoft abi where they have to get a different calling convention. I will try to refactor this into a method on Declarator in a second. llvm-svn: 195050
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaType.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 2fd9fc45d81..436b4b63ae0 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -3240,9 +3240,11 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
// top-level template type arguments.
bool FreeFunction;
if (!D.getCXXScopeSpec().isSet()) {
- FreeFunction = ((D.getContext() != Declarator::MemberContext &&
- D.getContext() != Declarator::LambdaExprContext) ||
- D.getDeclSpec().isFriendSpecified());
+ const DeclSpec &Spec = D.getDeclSpec();
+ FreeFunction = (D.getContext() != Declarator::MemberContext &&
+ D.getContext() != Declarator::LambdaExprContext) ||
+ Spec.isFriendSpecified() ||
+ Spec.getStorageClassSpec() == DeclSpec::SCS_typedef;
} else {
DeclContext *DC = S.computeDeclContext(D.getCXXScopeSpec());
FreeFunction = (DC && !DC->isRecord());
OpenPOWER on IntegriCloud