aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TemplateBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-21 22:10:26 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-21 22:10:26 +0000
commit03491de7b48e05f07731770c3fb51f02bc058079 (patch)
tree72bbe109f831764d14b3d69d571cbcfdb6fd70df /lib/AST/TemplateBase.cpp
parentf7dd69969aa25093ca9a7897a0d8819c145d1c77 (diff)
Add a hack to work around the lack of proper type-source info in a pack expansion TypeLoc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TemplateBase.cpp')
-rw-r--r--lib/AST/TemplateBase.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp
index fd1146c084..bfc834f090 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -295,8 +295,15 @@ TemplateArgumentLoc::getPackExpansionPattern(SourceLocation &Ellipsis,
switch (Argument.getKind()) {
case TemplateArgument::Type: {
+ // FIXME: We shouldn't ever have to worry about missing
+ // type-source info!
+ TypeSourceInfo *ExpansionTSInfo = getTypeSourceInfo();
+ if (!ExpansionTSInfo)
+ ExpansionTSInfo = Context.getTrivialTypeSourceInfo(
+ getArgument().getAsType(),
+ Ellipsis);
PackExpansionTypeLoc Expansion
- = cast<PackExpansionTypeLoc>(getTypeSourceInfo()->getTypeLoc());
+ = cast<PackExpansionTypeLoc>(ExpansionTSInfo->getTypeLoc());
Ellipsis = Expansion.getEllipsisLoc();
TypeLoc Pattern = Expansion.getPatternLoc();