]> granicus.if.org Git - clang/commit
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)
commit28bdbf0861fefb33474fddbda1d3c66ee29be2af
tree1f81ae9f4fab9fe61f4c7d90b050bf970b0d5993
parent34f3d05d0ee625dfcac951e2851f212c4c1a8b83
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188900 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Expr.cpp
lib/CodeGen/CGExpr.cpp
lib/Sema/SemaExpr.cpp
test/SemaCXX/predefined-expr.cpp [new file with mode: 0644]