Lines Matching refs:pointer_wrappers
417 namespace pointer_wrappers { namespace
443 template <> struct ValueIsPresent<pointer_wrappers::PTy> {
444 using UnwrappedType = pointer_wrappers::PTy;
445 static inline bool isPresent(const pointer_wrappers::PTy &P) { in isPresent()
448 static UnwrappedType &unwrapValue(pointer_wrappers::PTy &P) { return P; } in unwrapValue()
451 template <> struct ValueIsPresent<const pointer_wrappers::PTy> {
452 using UnwrappedType = pointer_wrappers::PTy;
453 static inline bool isPresent(const pointer_wrappers::PTy &P) { in isPresent()
457 static UnwrappedType &unwrapValue(const pointer_wrappers::PTy &P) { in unwrapValue()
462 template <> struct simplify_type<pointer_wrappers::PTy> {
463 typedef pointer_wrappers::Base *SimpleType;
464 static SimpleType getSimplifiedValue(pointer_wrappers::PTy &P) { in getSimplifiedValue()
468 template <> struct simplify_type<const pointer_wrappers::PTy> {
469 typedef pointer_wrappers::Base *SimpleType;
470 static SimpleType getSimplifiedValue(const pointer_wrappers::PTy &P) { in getSimplifiedValue()
478 namespace pointer_wrappers { namespace
481 pointer_wrappers::Base B;
482 pointer_wrappers::Derived D;
485 pointer_wrappers::PTy MN(nullptr);
486 pointer_wrappers::PTy MB(&B);
487 pointer_wrappers::PTy MD(&D);
490 const pointer_wrappers::PTy CN(nullptr);
491 const pointer_wrappers::PTy CB(&B);
492 const pointer_wrappers::PTy CD(&D);
495 EXPECT_TRUE(!isa<pointer_wrappers::Derived>(MB)); in TEST()
496 EXPECT_TRUE(!isa<pointer_wrappers::Derived>(CB)); in TEST()
497 EXPECT_TRUE(isa<pointer_wrappers::Derived>(MD)); in TEST()
498 EXPECT_TRUE(isa<pointer_wrappers::Derived>(CD)); in TEST()
502 EXPECT_EQ(cast<pointer_wrappers::Derived>(MD), &D); in TEST()
503 EXPECT_EQ(cast<pointer_wrappers::Derived>(CD), &D); in TEST()
507 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(MN), nullptr); in TEST()
508 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(CN), nullptr); in TEST()
509 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(MD), &D); in TEST()
510 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(CD), &D); in TEST()
514 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(MB), nullptr); in TEST()
515 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(CB), nullptr); in TEST()
516 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(MD), &D); in TEST()
517 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(CD), &D); in TEST()
521 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MN), nullptr); in TEST()
522 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CN), nullptr); in TEST()
523 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MB), nullptr); in TEST()
524 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CB), nullptr); in TEST()
525 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MD), &D); in TEST()
526 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CD), &D); in TEST()