mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 13:26:08 +00:00

really shouldn't be optional. Fix the remaining place where a temporary was being passed as potentially-aliased memory. Fixes PR10756. llvm-svn: 138627
21 lines
321 B
C++
21 lines
321 B
C++
// RUN: %clang_cc1 -emit-llvm-only %s
|
|
void f(bool flag) {
|
|
int a = 1;
|
|
int b = 2;
|
|
|
|
(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();
|
|
}
|
|
}
|