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 | 8ce189f9cefc4afba166c8868bbbfd336d103c28 (patch) | |
tree | 8824b609ce7405196f725c4f50b2b78c311c876a /clang/test/SemaCXX/conditional-expr.cpp | |
parent | 02ef4e3dba705b2a32add438154a9e240533af0c (diff) | |
download | bcm5719-llvm-8ce189f9cefc4afba166c8868bbbfd336d103c28.tar.gz bcm5719-llvm-8ce189f9cefc4afba166c8868bbbfd336d103c28.zip |
Conditional operator C++ checking complete. What issues remain are in more general code.
llvm-svn: 69555
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | clang/test/SemaCXX/conditional-expr.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp index 0366e67a1bf..331298dbf63 100644 --- a/clang/test/SemaCXX/conditional-expr.cpp +++ b/clang/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; |