summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplateVariadic.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-06-07 11:27:53 +0000
committerManuel Klimek <klimek@google.com>2013-06-07 11:27:53 +0000
commit20387efff0870da2c8b30bb62ae661239a903021 (patch)
tree81c9054c1b067fbb9941dfc01298b6f51337fd88 /lib/Sema/SemaTemplateVariadic.cpp
parent0d33f456ff36403d4a256d29739aa0bf10ce1aa8 (diff)
Reverts r183466: "Perform dynamic alignment computations..."
This introduces bugs in TemplateSpecializationTypeLoc's angle bracket locations. Regression test follows in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateVariadic.cpp')
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index cb6f4c19de..3b8228016c 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -18,7 +18,6 @@
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Template.h"
-#include "TypeLocBuilder.h"
using namespace clang;
@@ -464,13 +463,17 @@ Sema::CheckPackExpansion(TypeSourceInfo *Pattern, SourceLocation EllipsisLoc,
EllipsisLoc, NumExpansions);
if (Result.isNull())
return 0;
-
- TypeLocBuilder TLB;
- TLB.pushFullCopy(Pattern->getTypeLoc());
- PackExpansionTypeLoc TL = TLB.push<PackExpansionTypeLoc>(Result);
+
+ TypeSourceInfo *TSResult = Context.CreateTypeSourceInfo(Result);
+ PackExpansionTypeLoc TL =
+ TSResult->getTypeLoc().castAs<PackExpansionTypeLoc>();
TL.setEllipsisLoc(EllipsisLoc);
-
- return TLB.getTypeSourceInfo(Context, Result);
+
+ // Copy over the source-location information from the type.
+ memcpy(TL.getNextTypeLoc().getOpaqueData(),
+ Pattern->getTypeLoc().getOpaqueData(),
+ Pattern->getTypeLoc().getFullDataSize());
+ return TSResult;
}
QualType Sema::CheckPackExpansion(QualType Pattern, SourceRange PatternRange,