diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-19 21:53:20 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-19 21:53:20 +0000 |
commit | 78eb874222b7653edf7182d0d899d717d5c592c1 (patch) | |
tree | 68c058fb2df14216fbeb94f2899e52888bf4b2a2 /test/SemaCXX/conditional-expr.cpp | |
parent | 6c5cf4a2e234923ab66127de0874a71cb6bfdd83 (diff) |
Conditional operator C++ checking complete. What issues remain are in more general code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index 0366e67a1b..331298dbf6 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -108,11 +108,18 @@ void test() // should fail: const lost (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('struct Base' and 'struct Derived const')}} (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('struct Derived const' and 'struct Base')}} - // FIXME: should fail: private or ambiguous base + + // FIXME: these are invalid hierarchy conversions + Priv priv; + Fin fin; (void)(i1 ? Base() : Priv()); // xpected-error private base (void)(i1 ? Priv() : Base()); // xpected-error private base (void)(i1 ? Base() : Fin()); // xpected-error ambiguous base (void)(i1 ? Fin() : Base()); // xpected-error ambiguous base + (void)(i1 ? base : priv); // xpected-error private base + (void)(i1 ? priv : base); // xpected-error private base + (void)(i1 ? base : fin); // xpected-error ambiguous base + (void)(i1 ? fin : base); // xpected-error ambiguous base // b2.2 (non-hierarchy) i1 = i1 ? I() : i1; @@ -142,9 +149,8 @@ void test() double d1 = i1 ? I() : K(); pfn = i1 ? F() : G(); DFnPtr pfm; - // FIXME: Overload resolution won't choose the member pointer yet. - //pfm = i1 ? DFnPtr() : &Base::fn1; - //pfm = i1 ? &Base::fn1 : DFnPtr(); + pfm = i1 ? DFnPtr() : &Base::fn1; + pfm = i1 ? &Base::fn1 : DFnPtr(); // p6 (final conversions) i1 = i1 ? i1 : ir1; |