[PATCH] D149834: [clang][Interp] Fix ignoring TypeTraitExprs

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 06:10:57 PDT 2023


tbaeder updated this revision to Diff 520340.

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

https://reviews.llvm.org/D149834

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


Index: clang/test/AST/Interp/literals.cpp
===================================================================
--- clang/test/AST/Interp/literals.cpp
+++ clang/test/AST/Interp/literals.cpp
@@ -872,6 +872,7 @@
     (void)5, (void)6;
 
     1 ? 0 : 1;
+    __is_trivial(int);
 
     return 0;
   }
Index: clang/lib/AST/Interp/ByteCodeExprGen.cpp
===================================================================
--- clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -1038,6 +1038,8 @@
 
 template <class Emitter>
 bool ByteCodeExprGen<Emitter>::VisitTypeTraitExpr(const TypeTraitExpr *E) {
+  if (DiscardResult)
+    return true;
   return this->emitConstBool(E->getValue(), E);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149834.520340.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230508/589c11a0/attachment.bin>


More information about the cfe-commits mailing list