1 // RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s
2 // RUN: %clang_analyze_cc1 -std=c++17 -analyzer-checker=core,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s
4 #include "Inputs/system-header-simulator-cxx.h"
6 void clang_analyzer_warnIfReached();
7 void clang_analyzer_eval(int);
9 // Capture copy elided object.
15 void testCopyElidedObjectCaptured(int x
) {
16 int r
= [e
= Elided(x
)] {
20 clang_analyzer_eval(r
== 14); // expected-warning{{TRUE}}
23 static auto MakeUniquePtr() { return std::make_unique
<std::vector
<int>>(); }
25 void testCopyElidedUniquePtr() {
26 [uniquePtr
= MakeUniquePtr()] {}();
27 clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}