Lines Matching defs: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 0; }
51 return cast<foo>(this);
106 TEST(CastingTest, cast) {
107 foo &F1 = cast<foo>(B1);
109 const foo *F3 = cast<foo>(B2);
111 const foo *F4 = cast<foo>(B2);
113 const foo &F5 = cast<foo>(B3);
115 const foo *F6 = cast<foo>(B4);
117 // Can't pass null pointer to cast<>.
118 // foo *F7 = cast<foo>(fub());
165 //foo *F20 = cast<foo>(B2); // Yields const foo*
166 //foo &F21 = cast<foo>(B3); // Yields const foo&
167 //foo *F22 = cast<foo>(B4); // Yields const foo*
196 // Even with no explicit classof() in Base, we should still be able to cast
226 // Test that we reject casts of temporaries (and so the illegal cast gets used).
229 IllegalCast *testIllegalCast() { return cast<foo>(pod()); }