Lines Matching refs:pointer_wrappers
386 namespace pointer_wrappers { namespace
412 template <> struct ValueIsPresent<pointer_wrappers::PTy> {
413 using UnwrappedType = pointer_wrappers::PTy;
414 static inline bool isPresent(const pointer_wrappers::PTy &P) { in isPresent()
417 static UnwrappedType &unwrapValue(pointer_wrappers::PTy &P) { return P; } in unwrapValue()
420 template <> struct ValueIsPresent<const pointer_wrappers::PTy> {
421 using UnwrappedType = pointer_wrappers::PTy;
422 static inline bool isPresent(const pointer_wrappers::PTy &P) { in isPresent()
426 static UnwrappedType &unwrapValue(const pointer_wrappers::PTy &P) { in unwrapValue()
431 template <> struct simplify_type<pointer_wrappers::PTy> {
432 typedef pointer_wrappers::Base *SimpleType;
433 static SimpleType getSimplifiedValue(pointer_wrappers::PTy &P) { in getSimplifiedValue()
437 template <> struct simplify_type<const pointer_wrappers::PTy> {
438 typedef pointer_wrappers::Base *SimpleType;
439 static SimpleType getSimplifiedValue(const pointer_wrappers::PTy &P) { in getSimplifiedValue()
447 namespace pointer_wrappers { namespace
450 pointer_wrappers::Base B;
451 pointer_wrappers::Derived D;
454 pointer_wrappers::PTy MN(nullptr);
455 pointer_wrappers::PTy MB(&B);
456 pointer_wrappers::PTy MD(&D);
459 const pointer_wrappers::PTy CN(nullptr);
460 const pointer_wrappers::PTy CB(&B);
461 const pointer_wrappers::PTy CD(&D);
464 EXPECT_TRUE(!isa<pointer_wrappers::Derived>(MB)); in TEST()
465 EXPECT_TRUE(!isa<pointer_wrappers::Derived>(CB)); in TEST()
466 EXPECT_TRUE(isa<pointer_wrappers::Derived>(MD)); in TEST()
467 EXPECT_TRUE(isa<pointer_wrappers::Derived>(CD)); in TEST()
471 EXPECT_EQ(cast<pointer_wrappers::Derived>(MD), &D); in TEST()
472 EXPECT_EQ(cast<pointer_wrappers::Derived>(CD), &D); in TEST()
476 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(MN), nullptr); in TEST()
477 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(CN), nullptr); in TEST()
478 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(MD), &D); in TEST()
479 EXPECT_EQ(cast_or_null<pointer_wrappers::Derived>(CD), &D); in TEST()
483 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(MB), nullptr); in TEST()
484 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(CB), nullptr); in TEST()
485 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(MD), &D); in TEST()
486 EXPECT_EQ(dyn_cast<pointer_wrappers::Derived>(CD), &D); in TEST()
490 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MN), nullptr); in TEST()
491 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CN), nullptr); in TEST()
492 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MB), nullptr); in TEST()
493 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CB), nullptr); in TEST()
494 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(MD), &D); in TEST()
495 EXPECT_EQ(dyn_cast_or_null<pointer_wrappers::Derived>(CD), &D); in TEST()