diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-07-20 19:49:47 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-07-20 19:49:47 +0000 |
| commit | 81383c20e4c6aa506842397c53112eee7ed8efb0 (patch) | |
| tree | 0f03bf5a44fd3cb1ee21de06a701b3700acc5f05 /clang/test | |
| parent | 82f64488ec614d7b0abcc5b3c0fc13b590b95f60 (diff) | |
| download | bcm5719-llvm-81383c20e4c6aa506842397c53112eee7ed8efb0.tar.gz bcm5719-llvm-81383c20e4c6aa506842397c53112eee7ed8efb0.zip | |
Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.
llvm-svn: 135610
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/uninit-variables.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninit-variables.cpp b/clang/test/SemaCXX/uninit-variables.cpp index a0180e3d3a1..a850a2f92f1 100644 --- a/clang/test/SemaCXX/uninit-variables.cpp +++ b/clang/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: |

