diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-19 23:40:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-19 23:40:50 +0000 |
commit | b65a45835afcc93fa99e22b14b4c9734c261d831 (patch) | |
tree | eedc52141116fbc3aff9bb0c0ee3c18b835538b4 /test/SemaCXX/conditional-expr.cpp | |
parent | a5da90253a1a28ff4f4a20374458f50721875b77 (diff) |
When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.
Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index f1fe8ba79b..a09ff2bd41 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -255,3 +255,23 @@ namespace test1 { foo(a ? a->x() : 0); } } + +namespace rdar7998817 { + class X { + X(X&); // expected-note{{declared private here}} + + struct ref { }; + + public: + X(); + X(ref); + + operator ref(); + }; + + void f(bool B) { + X x; + (void)(B? x // expected-error{{calling a private constructor of class 'rdar7998817::X'}} + : X()); + } +} |