diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-04-03 07:51:34 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-04-03 07:51:34 +0000 |
commit | ac616af773f5062edaaf1a0bb5610b49a22ac41f (patch) | |
tree | 1e9c2f464daf7966d11aa31cf069fa1bc63fdb21 /test/SemaCXX/conditional-expr.cpp | |
parent | 07b2cfcdb817cc0790420f159a313d61e7241cb9 (diff) | |
download | FreeBSD-src-ac616af773f5062edaaf1a0bb5610b49a22ac41f.zip FreeBSD-src-ac616af773f5062edaaf1a0bb5610b49a22ac41f.tar.gz |
Update clang to r100285.
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index e2a966bd..49bcd99 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -213,3 +213,30 @@ namespace PR6595 { (void)(Cond? a : S); } } + +namespace PR6757 { + struct Foo1 { + Foo1(); + Foo1(const Foo1&); + }; + + struct Foo2 { }; + + struct Foo3 { + Foo3(); + Foo3(Foo3&); + }; + + struct Bar { + operator const Foo1&() const; + operator const Foo2&() const; + operator const Foo3&() const; + }; + + void f() { + (void)(true ? Bar() : Foo1()); // okay + (void)(true ? Bar() : Foo2()); // okay + // FIXME: Diagnostic below could be improved + (void)(true ? Bar() : Foo3()); // expected-error{{incompatible operand types ('PR6757::Bar' and 'PR6757::Foo3')}} + } +} |