diff options
Diffstat (limited to 'test/Analysis/lambdas.cpp')
-rw-r--r-- | test/Analysis/lambdas.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Analysis/lambdas.cpp b/test/Analysis/lambdas.cpp index f3ff9b953938..38a2e3a84fb1 100644 --- a/test/Analysis/lambdas.cpp +++ b/test/Analysis/lambdas.cpp @@ -337,6 +337,16 @@ void captureByReference() { lambda2(); } +void testCapturedConstExprFloat() { + constexpr float localConstant = 4.0; + auto lambda = []{ + // Don't treat localConstant as containing a garbage value + float copy = localConstant; // no-warning + (void)copy; + }; + + lambda(); +} // CHECK: [B2 (ENTRY)] // CHECK: Succs (1): B1 |