Home | History | Annotate | Download | only in Support

Lines Matching refs:cast

18 // Used to test illegal cast. If a cast doesn't match any of the "real" ones,
21 template <typename T> IllegalCast *cast(...) { return nullptr; }
51 return cast<foo>(this);
110 TEST(CastingTest, cast) {
111 foo &F1 = cast<foo>(B1);
113 const foo *F3 = cast<foo>(B2);
115 const foo *F4 = cast<foo>(B2);
117 const foo &F5 = cast<foo>(B3);
119 const foo *F6 = cast<foo>(B4);
121 // Can't pass null pointer to cast<>.
122 // foo *F7 = cast<foo>(fub());
169 //foo *F20 = cast<foo>(B2); // Yields const foo*
170 //foo &F21 = cast<foo>(B3); // Yields const foo&
171 //foo *F22 = cast<foo>(B4); // Yields const foo*
200 // Even with no explicit classof() in Base, we should still be able to cast
230 // Test that we reject casts of temporaries (and so the illegal cast gets used).
233 IllegalCast *testIllegalCast() { return cast<foo>(pod()); }
302 EXPECT_TRUE(cast<pointer_wrappers::Derived>(MD) == &D);
303 EXPECT_TRUE(cast<pointer_wrappers::Derived>(CD) == &D);