aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/uninit-variables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-20 19:49:47 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-20 19:49:47 +0000
commitdd4286b5b7b02b8bb962e4b996b8f36cb7935d4f (patch)
tree378d9e4a72c0055c78d6bcb80c1f8f7f5b7a2b20 /test/SemaCXX/uninit-variables.cpp
parent97f16dc89615de398b044d700886a27bef4e1be6 (diff)
Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/uninit-variables.cpp')
-rw-r--r--test/SemaCXX/uninit-variables.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp
index a0180e3d3a..a850a2f92f 100644
--- a/test/SemaCXX/uninit-variables.cpp
+++ b/test/SemaCXX/uninit-variables.cpp
@@ -66,6 +66,16 @@ test4_A test4() {
return a; // expected-warning{{variable 'a' is uninitialized when used here}}
}
+// Test variables getting invalidated by function calls with reference arguments
+// *AND* there are multiple invalidated arguments.
+void test5_aux(int &, int &);
+
+int test5() {
+ int x, y;
+ test5_aux(x, y);
+ return x + y; // no-warning
+}
+
// This test previously crashed Sema.
class Rdar9188004A {
public: