diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-01 03:43:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-01 03:43:00 +0000 |
commit | 4712c02c1550a72612c07f5aaee455dcd8273b96 (patch) | |
tree | 42cde706764ccbf43a275254513448c36cbe893b /test/SemaCXX/conditional-expr.cpp | |
parent | 4b662a5684d41ea4ff6b52711929e00fefb00db1 (diff) |
When performing copy initialization via user-defined conversions,
don't allow two user-defined conversions. Fixes PR6595 (again).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index a09ff2bd41..d008b8d6ed 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -199,17 +199,24 @@ void test() } namespace PR6595 { + struct OtherString { + OtherString(); + OtherString(const char*); + }; + struct String { String(const char *); + String(const OtherString&); operator const char*() const; }; - void f(bool Cond, String S) { + void f(bool Cond, String S, OtherString OS) { (void)(Cond? S : ""); (void)(Cond? "" : S); const char a[1] = {'a'}; (void)(Cond? S : a); (void)(Cond? a : S); + (void)(Cond? OS : S); } } |