]> granicus.if.org Git - clang/commit
CodeGen: Don't crash when a lambda uses a local constexpr variable
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 1 Jan 2015 09:49:44 +0000 (09:49 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 1 Jan 2015 09:49:44 +0000 (09:49 +0000)
commit2e98270d45c3201e0ad684a798d217a9d0bfb258
treec2141c1682f99a051ee5f585613b07cdfce08713
parentdb09ccd826e53832382e04d0f4fb9bc9c45e0852
CodeGen: Don't crash when a lambda uses a local constexpr variable

The DeclRefExpr might be for a variable initialized by a constant
expression which hasn't been ODR used.
Emit the initializer for the variable instead of trying to capture the
variable itself.

This fixes PR22071.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225060 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
test/CodeGenCXX/lambda-expressions.cpp