summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTImporter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-12 18:42:33 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-12 18:42:33 +0000
commit81495f341d4a8a06a1d775c31562a37dc2f9c7fe (patch)
tree3b34fb85073dac1f4dfb7a241b0522b6c9db1114 /clang/lib/AST/ASTImporter.cpp
parentd74dd49065ba4109b8b04209fd197d85857d4281 (diff)
downloadbcm5719-llvm-81495f341d4a8a06a1d775c31562a37dc2f9c7fe.tar.gz
bcm5719-llvm-81495f341d4a8a06a1d775c31562a37dc2f9c7fe.zip
Within the body of a lambda expression, decltype((x)) for an
id-expression 'x' will compute the type based on the assumption that 'x' will be captured, even if it isn't captured, per C++11 [expr.prim.lambda]p18. There are two related refactors that go into implementing this: 1) Split out the check that determines whether we should capture a particular variable reference, along with the computation of the type of the field, from the actual act of capturing the variable. 2) Always compute the result of decltype() within Sema, rather than AST, because the decltype() computation is now context-sensitive. llvm-svn: 150347
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r--clang/lib/AST/ASTImporter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 556f97d8582..e15bac0b447 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -1581,7 +1581,11 @@ QualType ASTNodeImporter::VisitDecltypeType(const DecltypeType *T) {
if (!ToExpr)
return QualType();
- return Importer.getToContext().getDecltypeType(ToExpr);
+ QualType UnderlyingType = Importer.Import(T->getUnderlyingType());
+ if (UnderlyingType.isNull())
+ return QualType();
+
+ return Importer.getToContext().getDecltypeType(ToExpr, UnderlyingType);
}
QualType ASTNodeImporter::VisitUnaryTransformType(const UnaryTransformType *T) {
OpenPOWER on IntegriCloud