aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 9d7d3d087c..0c413f6742 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -336,8 +336,15 @@ NamedDecl *NamedDecl::getUnderlyingDecl() {
//===----------------------------------------------------------------------===//
SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
- if (DeclInfo)
- return DeclInfo->getTypeLoc().getTypeSpecRange().getBegin();
+ if (DeclInfo) {
+ TypeLoc TL = DeclInfo->getTypeLoc();
+ while (true) {
+ TypeLoc NextTL = TL.getNextTypeLoc();
+ if (!NextTL)
+ return TL.getSourceRange().getBegin();
+ TL = NextTL;
+ }
+ }
return SourceLocation();
}