Sema: Use the right type for PredefinedExpr when it's in a lambda.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Aug 2013 11:45:27 +0000 (11:45 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Aug 2013 11:45:27 +0000 (11:45 +0000)
commit90f54229545e955d2e8ab37c25b6c2e88ec5a271
treeddb2010868284271edf28fe91724ddf2f50f39cc
parent33d447a2d6fc0f97ed5f502c6dd2eca0a88be251
Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

llvm-svn: 188900
clang/lib/AST/Expr.cpp
clang/lib/CodeGen/CGExpr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/SemaCXX/predefined-expr.cpp [new file with mode: 0644]