diff options
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index c0c78bfb36..e2a966bdd9 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -198,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); + } +} |