aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/stack-addr-ps.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-08-17 10:12:33 +0000
committerHans Wennborg <hans@hanshq.net>2012-08-17 10:12:33 +0000
commit8be9e77f7e532866fa0ef2bc8c3cd549f0cc8da2 (patch)
tree659b0a4c7f789355f04e19029a6e6db1813756b8 /test/Analysis/stack-addr-ps.cpp
parent66a3d4754977cf0e98e510af9d68d00cbc14b7a8 (diff)
Warn about self-initialization of references.
Initializing a reference with itself, e.g. "int &a = a;" seems like a very bad idea. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/stack-addr-ps.cpp')
-rw-r--r--test/Analysis/stack-addr-ps.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Analysis/stack-addr-ps.cpp b/test/Analysis/stack-addr-ps.cpp
index b21a03dc38..cbdb143c18 100644
--- a/test/Analysis/stack-addr-ps.cpp
+++ b/test/Analysis/stack-addr-ps.cpp
@@ -87,6 +87,6 @@ struct TS {
// rdar://11345441
int* f5() {
- int& i = i; // expected-warning {{Assigned value is garbage or undefined}} expected-note {{binding reference variable 'i' here}}
+ int& i = i; // expected-warning {{Assigned value is garbage or undefined}} expected-note {{binding reference variable 'i' here}} expected-warning{{variable 'i' is uninitialized when used within its own initialization}}
return &i; // expected-warning {{address of stack memory associated with local variable 'i' returned}}
}