[clang] cbfcfdf - [clang][NFC] Add a test for CWG2254 to `is_pointer_interconvertible_base_of` tests

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 13 05:17:11 PDT 2024


Author: Vlad Serebrennikov
Date: 2024-04-13T15:17:04+03:00
New Revision: cbfcfdf75e9939bc47ac7a7c11d2122a6ad426ed

URL: https://github.com/llvm/llvm-project/commit/cbfcfdf75e9939bc47ac7a7c11d2122a6ad426ed
DIFF: https://github.com/llvm/llvm-project/commit/cbfcfdf75e9939bc47ac7a7c11d2122a6ad426ed.diff

LOG: [clang][NFC] Add a test for CWG2254 to `is_pointer_interconvertible_base_of` tests

Resolution of that issue makes _any_ base class subobject interconvertible with the containing object, not just the first one.

Added: 
    

Modified: 
    clang/test/SemaCXX/type-traits.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/type-traits.cpp b/clang/test/SemaCXX/type-traits.cpp
index d43701c3d976e0..dee4a29bd2bffe 100644
--- a/clang/test/SemaCXX/type-traits.cpp
+++ b/clang/test/SemaCXX/type-traits.cpp
@@ -1864,6 +1864,7 @@ void is_pointer_interconvertible_base_of(int n)
   static_assert(!__is_pointer_interconvertible_base_of(Base2, Derived));
   static_assert(__is_pointer_interconvertible_base_of(Base, DerivedIndirect));
   static_assert(__is_pointer_interconvertible_base_of(Base, DerivedMultiple));
+  static_assert(__is_pointer_interconvertible_base_of(Base2, DerivedMultiple));
   static_assert(!__is_pointer_interconvertible_base_of(Base3, DerivedMultiple));
   static_assert(!__is_pointer_interconvertible_base_of(Base, DerivedAmbiguous));
   static_assert(__is_pointer_interconvertible_base_of(Base, DerivedPrivate));


        


More information about the cfe-commits mailing list