diff options
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index accc8db..e2a966bd 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -7,7 +7,8 @@ struct ToBool { explicit operator bool(); }; struct B; -struct A { A(); A(const B&); }; // expected-note 2 {{candidate constructor}} +struct A { A(); A(const B&); }; // expected-note 2 {{candidate constructor}} \ + // expected-note 2 {{candidate is the implicit copy constructor}} struct B { operator A() const; }; // expected-note 2 {{candidate function}} struct I { operator int(); }; struct J { operator I(); }; @@ -197,3 +198,18 @@ void test() // *must* create a separate temporary copy of class objects. This can only // be properly tested at runtime, though. } + +namespace PR6595 { + struct String { + String(const char *); + operator const char*() const; + }; + + void f(bool Cond, String S) { + (void)(Cond? S : ""); + (void)(Cond? "" : S); + const char a[1] = {'a'}; + (void)(Cond? S : a); + (void)(Cond? a : S); + } +} |