diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-23 21:41:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-23 21:41:42 +0000 |
commit | d784e6893cfbdd24b4f701e486adbab9906d4b27 (patch) | |
tree | cb6c302cc41d7d560f657e3ec93c7b0b75a4cb1d /clang/lib/AST/StmtProfile.cpp | |
parent | ed9b8f0a373b01e93b139f33a85465d79b7154df (diff) | |
download | bcm5719-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.cpp | 8 |
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( |