[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 09:38:00 PDT 2023


aaron.ballman added a comment.

In D150364#4335261 <https://reviews.llvm.org/D150364#4335261>, @tbaeder wrote:

> In D150364#4335221 <https://reviews.llvm.org/D150364#4335221>, @aaron.ballman wrote:
>
>> "Unsupported" is a bit of a loaded term -- it could mean "this operation is not supported, YET" or it could mean "this operation is not and will not be supported, EVER". Perhaps something more like "InvalidInConstantExpr" would be more descriptive?
>
> I guess it would be more descriptive, but it could still mean that it is "not yet valid in a constant expression", so I guess I don't see the upside of using a longer opcode name.

I don't feel strongly; it's easy enough to rename if we think it's causing confusion. FWIW, my first thought was "Oh, we're planning to support throw expressions in constant expressions? Please don't tell WG21." I'm used to seeing "invalid" for things that are never valid and "unsupported" for things that aren't supported but might be someday. However, I also see we use "unsupported" in the same sense you're using it here in some of our diagnostics, so I'm fine with whatever you want to go with.



================
Comment at: clang/test/AST/Interp/records.cpp:341
+
+    /// FIXME: Wrong source location below.
+    return 12; // expected-note {{in call to '&S{}->~S()'}}
----------------
Oh interesting -- does the old constexpr interpreter think the destructor is called at the end of the block as opposed to at the end of the full expression with the temporary?


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

https://reviews.llvm.org/D150364



More information about the cfe-commits mailing list