[clang] [clang][Interp] Handle AttributedStmts (PR #66495)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 05:40:43 PDT 2023


================
@@ -628,6 +630,12 @@ bool ByteCodeStmtGen<Emitter>::visitAsmStmt(const AsmStmt *S) {
   return this->emitInvalid(S);
 }
 
+template <class Emitter>
+bool ByteCodeStmtGen<Emitter>::visitAttributedStmt(const AttributedStmt *S) {
+  // Ignore all attributes.
----------------
tbaederr wrote:

> Is this what we want to do for [[assume]]? We can do it this way: https://eel.is/c++draft/expr.const#5.8 but we can also do it better: https://eel.is/c++draft/expr.const#5.33

The second case would essentially work like an assertion? If this fails, the statement isn't a constant expression?

https://github.com/llvm/llvm-project/pull/66495


More information about the cfe-commits mailing list