diff options
author | John McCall <rjmccall@apple.com> | 2011-08-26 07:31:35 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-08-26 07:31:35 +0000 |
commit | 4418439220a8f8e0b1deffdccce2354854c702f5 (patch) | |
tree | 1107662bf5675e886ecb60f77802fc7ee3ea1f16 /test/CodeGenCXX/conditional-expr-lvalue.cpp | |
parent | 90b2bdf3b96892ea44e5bf6869a92a08d09a6545 (diff) |
Since the 'is aliased' bit is critical for correctness in C++, it
really shouldn't be optional. Fix the remaining place where a
temporary was being passed as potentially-aliased memory.
Fixes PR10756.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/conditional-expr-lvalue.cpp')
-rw-r--r-- | test/CodeGenCXX/conditional-expr-lvalue.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/conditional-expr-lvalue.cpp b/test/CodeGenCXX/conditional-expr-lvalue.cpp index a0843c40f0..96aa8b07a6 100644 --- a/test/CodeGenCXX/conditional-expr-lvalue.cpp +++ b/test/CodeGenCXX/conditional-expr-lvalue.cpp @@ -5,3 +5,16 @@ void f(bool flag) { (flag ? a : b) = 3; } + +// PR10756 +namespace test0 { + struct A { + A(const A &); + A &operator=(const A &); + A sub() const; + void foo() const; + }; + void foo(bool cond, const A &a) { + (cond ? a : a.sub()).foo(); + } +} |