aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-02 22:36:29 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-02 22:36:29 +0000
commit802ab45fea51beff12f386329d4928811a479c6e (patch)
treeea2562795e9d83477eac5c20a2ae1d2e27a0d420 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent467f030960b96d9e531442974fc916d53c0a03dd (diff)
Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type and a single location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 8808bf72db..95725bf44f 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1620,14 +1620,19 @@ Sema::InstantiateMemInitializers(CXXConstructorDecl *New,
MemInitResult NewInit;
if (Init->isBaseInitializer()) {
- QualType BaseType(Init->getBaseClass(), 0);
- BaseType = SubstType(BaseType, TemplateArgs, Init->getSourceLocation(),
- New->getDeclName());
-
- NewInit = BuildBaseInitializer(BaseType,
+ DeclaratorInfo *BaseDInfo = SubstType(Init->getBaseClassInfo(),
+ TemplateArgs,
+ Init->getSourceLocation(),
+ New->getDeclName());
+ if (!BaseDInfo) {
+ New->setInvalidDecl();
+ continue;
+ }
+
+ NewInit = BuildBaseInitializer(BaseDInfo->getType(), BaseDInfo,
(Expr **)NewArgs.data(),
NewArgs.size(),
- Init->getSourceLocation(),
+ Init->getLParenLoc(),
Init->getRParenLoc(),
New->getParent());
} else if (Init->isMemberInitializer()) {
@@ -1643,6 +1648,7 @@ Sema::InstantiateMemInitializers(CXXConstructorDecl *New,
NewInit = BuildMemberInitializer(Member, (Expr **)NewArgs.data(),
NewArgs.size(),
Init->getSourceLocation(),
+ Init->getLParenLoc(),
Init->getRParenLoc());
}