[PATCH] D67113: ICK_Function_Conversion is a third kind conversion
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 28 15:31:47 PDT 2020
aaronpuchert added a comment.
Herald added a subscriber: danielkiss.
In D67113#2244463 <https://reviews.llvm.org/D67113#2244463>, @aaron.ballman wrote:
> There may be a deeper issue here in that there are four standard conversion sequences, not three: http://eel.is/c++draft/conv#1, but otherwise this change seems correct to me (function conversion is certainly not in the first group).
It seems we've collapsed the third and fourth kind into one, I wonder if that makes a difference. This can even be observed in the AST:
void f() noexcept;
void (*const fp)() = f;
// VarDecl fp 'void (*const)()' cinit
// (2) `-ImplicitCastExpr 'void (*const)()' <NoOp>
// (1) `-ImplicitCastExpr 'void (*)() noexcept' <FunctionToPointerDecay>
// `-DeclRefExpr 'void () noexcept' lvalue Function 'f' 'void () noexcept'
where (1) is a first kind conversion, and (2) a combined third and fourth kind conversion. Since both are essentially no-ops (see also D67112 <https://reviews.llvm.org/D67112>), it probably doesn't make sense to go into more detail.
> Do you have a test case which can exercise this change?
Nope, just discovered this while reading the code. This should be unreachable, so it would be bad if I could observe a change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67113/new/
https://reviews.llvm.org/D67113
More information about the cfe-commits
mailing list