diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 11:21:02 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 11:21:02 +0000 |
commit | a5cd2cdd11179387aa01f43cb6d6af440e006553 (patch) | |
tree | 7493d901e7c50fc540cb39df024f674610b8b6aa /test/SemaCXX/conditional-expr.cpp | |
parent | 5414fbac5f1749c0e85a8c4eeb5dfece59c3e30a (diff) |
Make reference class unification in conditional expressions check for validity of the conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index 331298dbf6..3fede303b6 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -25,7 +25,7 @@ struct Derived : Base { void fn2(); }; struct Convertible { operator Base&(); }; -struct Priv : private Base {}; +struct Priv : private Base {}; // expected-note 2 {{'private' inheritance specifier here}} struct Mid : Base {}; struct Fin : Mid, Derived {}; typedef void (Derived::*DFnPtr)(); @@ -116,10 +116,10 @@ void test() (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 + (void)(i1 ? base : priv); // expected-error {{conversion from 'struct Priv' to inaccessible base class 'struct Base'}} + (void)(i1 ? priv : base); // expected-error {{conversion from 'struct Priv' to inaccessible base class 'struct Base'}} + (void)(i1 ? base : fin); // expected-error {{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}} + (void)(i1 ? fin : base); // expected-error {{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}} // b2.2 (non-hierarchy) i1 = i1 ? I() : i1; |