[PATCH] D137545: [clang][Interp] DerivedToBase casts

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 23:38:33 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7863646fd206: [clang][Interp] DerivedToBase casts (authored by tbaeder).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137545/new/

https://reviews.llvm.org/D137545

Files:
  clang/lib/AST/Interp/ByteCodeExprGen.cpp
  clang/test/AST/Interp/records.cpp


Index: clang/test/AST/Interp/records.cpp
===================================================================
--- clang/test/AST/Interp/records.cpp
+++ clang/test/AST/Interp/records.cpp
@@ -245,6 +245,8 @@
   static_assert(c.a == 10, "");
   static_assert(c.b == 20, "");
 
+  constexpr const A *aPointer = &c;
+  constexpr const B *bPointer = &c;
 
   class D : private A, private B {
     public:
Index: clang/lib/AST/Interp/ByteCodeExprGen.cpp
===================================================================
--- clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -107,7 +107,8 @@
         });
   }
 
-  case CK_UncheckedDerivedToBase: {
+  case CK_UncheckedDerivedToBase:
+  case CK_DerivedToBase: {
     if (!this->visit(SubExpr))
       return false;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137545.474668.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221111/1874f5fc/attachment.bin>


More information about the cfe-commits mailing list