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/Serialization/ASTWriterStmt.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/Serialization/ASTWriterStmt.cpp')
| -rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 41e9f969921..92d21389cbb 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1558,11 +1558,18 @@ void ASTStmtWriter::VisitPackExpansionExpr(PackExpansionExpr *E) { void ASTStmtWriter::VisitSizeOfPackExpr(SizeOfPackExpr *E) { VisitExpr(E); + Record.push_back(E->isPartiallySubstituted() ? E->getPartialArguments().size() + : 0); Writer.AddSourceLocation(E->OperatorLoc, Record); Writer.AddSourceLocation(E->PackLoc, Record); Writer.AddSourceLocation(E->RParenLoc, Record); - Record.push_back(E->Length); Writer.AddDeclRef(E->Pack, Record); + if (E->isPartiallySubstituted()) { + for (const auto &TA : E->getPartialArguments()) + Writer.AddTemplateArgument(TA, Record); + } else if (!E->isValueDependent()) { + Record.push_back(E->getPackLength()); + } Code = serialization::EXPR_SIZEOF_PACK; } |

