summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-09-23 21:41:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-09-23 21:41:42 +0000
commitd784e6893cfbdd24b4f701e486adbab9906d4b27 (patch)
treecb6c302cc41d7d560f657e3ec93c7b0b75a4cb1d /clang/lib/AST/StmtProfile.cpp
parented9b8f0a373b01e93b139f33a85465d79b7154df (diff)
downloadbcm5719-llvm-d784e6893cfbdd24b4f701e486adbab9906d4b27.tar.gz
bcm5719-llvm-d784e6893cfbdd24b4f701e486adbab9906d4b27.zip
PR14858: Initial support for proper sizeof... handling within alias templates.
This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r--clang/lib/AST/StmtProfile.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 231f450c9b4..b379745b4af 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -1313,6 +1313,14 @@ void StmtProfiler::VisitPackExpansionExpr(const PackExpansionExpr *S) {
void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
VisitExpr(S);
VisitDecl(S->getPack());
+ if (S->isPartiallySubstituted()) {
+ auto Args = S->getPartialArguments();
+ ID.AddInteger(Args.size());
+ for (const auto &TA : Args)
+ VisitTemplateArgument(TA);
+ } else {
+ ID.AddInteger(0);
+ }
}
void StmtProfiler::VisitSubstNonTypeTemplateParmPackExpr(
OpenPOWER on IntegriCloud