diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-13 21:01:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-13 21:01:28 +0000 |
commit | 0950e41b73587a71ee66c88cf8db0dfff343a8cf (patch) | |
tree | a7d6054a981badf7424c934d5e12969bb3da8070 /clang/lib/AST/StmtSerialization.cpp | |
parent | 5b86bf527ea41117edac3728e6d803d8723de888 (diff) | |
download | bcm5719-llvm-0950e41b73587a71ee66c88cf8db0dfff343a8cf.tar.gz bcm5719-llvm-0950e41b73587a71ee66c88cf8db0dfff343a8cf.zip |
Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo)
- sizeof(), alignof()
More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.
llvm-svn: 66947
Diffstat (limited to 'clang/lib/AST/StmtSerialization.cpp')
-rw-r--r-- | clang/lib/AST/StmtSerialization.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/AST/StmtSerialization.cpp b/clang/lib/AST/StmtSerialization.cpp index 4a90edd7a1e..78366a1514f 100644 --- a/clang/lib/AST/StmtSerialization.cpp +++ b/clang/lib/AST/StmtSerialization.cpp @@ -832,9 +832,14 @@ SizeOfAlignOfExpr::CreateImpl(Deserializer& D, ASTContext& C) { QualType Res = QualType::ReadVal(D); SourceLocation OpLoc = SourceLocation::ReadVal(D); SourceLocation RParenLoc = SourceLocation::ReadVal(D); - - return new SizeOfAlignOfExpr(isSizeof, isType, Argument, Res, - OpLoc, RParenLoc); + + if (isType) + return new (C) SizeOfAlignOfExpr(isSizeof, + QualType::getFromOpaquePtr(Argument), + Res, OpLoc, RParenLoc); + + return new (C) SizeOfAlignOfExpr(isSizeof, (Expr *)Argument, + Res, OpLoc, RParenLoc); } void StmtExpr::EmitImpl(Serializer& S) const { |