As discussed the other day. This fixes the diagnostics for the test case in records.cpp.
Details
Diff Detail
Event Timeline
I've unfortunately not caught up enough to comment on the approach, but 'inline assembly' has the same restriction, so you might find MsAsmStmt and GCCAsmStmt to be equally as easy 'wins'.
"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?
clang/test/AST/Interp/unsupported.cpp | ||
---|---|---|
4–6 | Can get rid of some whitespace. |
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.
clang/test/AST/Interp/records.cpp | ||
---|---|---|
341 | 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? |
clang/test/AST/Interp/records.cpp | ||
---|---|---|
341 | I think it's the other way around and the new one does that (expected is the new one). Need to investigate that. |
LGTM
clang/test/AST/Interp/records.cpp | ||
---|---|---|
341 | Ah oops, you're right, I did have that backwards. That makes more sense, thanks. :-) |
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?