From b63931eef6bfcf900216dc1a180b29dcaa287090 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 18 Jan 2011 21:18:58 +0000 Subject: Teach UninitializedValuesV2 to implicitly reason about C++ references by monitoring whether an access to a variable is solely to compute it's lvalue or to do an lvalue-to-rvalue conversion (i.e., a load). llvm-svn: 123777 --- clang/test/SemaCXX/uninit-variables.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 clang/test/SemaCXX/uninit-variables.cpp (limited to 'clang/test/SemaCXX/uninit-variables.cpp') diff --git a/clang/test/SemaCXX/uninit-variables.cpp b/clang/test/SemaCXX/uninit-variables.cpp new file mode 100644 index 00000000000..e971357ca78 --- /dev/null +++ b/clang/test/SemaCXX/uninit-variables.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only %s -verify + +int test1_aux(int &x); +int test1() { + int x; + test1_aux(x); + return x; // no-warning +} + +int test2_aux() { + int x; + int &y = x; + return x; // no-warning +} + -- cgit v1.2.3