[PATCH] D67112: [Sema] Introduce function reference conversion, NFC

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 17:17:23 PST 2020


rsmith added a comment.

In D67112#2401110 <https://reviews.llvm.org/D67112#2401110>, @aaronpuchert wrote:

> In D67112#2398577 <https://reviews.llvm.org/D67112#2398577>, @rsmith wrote:
>
>> Looks fine as far as it goes, but it looks like we're also missing a cast in function pointer initialization via function conversion:
>> [...]
>>
>>   |-VarDecl 0x105143e8 <line:2:1, col:15> col:8 p 'void (*)()' cinit
>>   | `-ImplicitCastExpr 0x10514498 <col:15> 'void (*)() noexcept' <FunctionToPointerDecay>
>>   |   `-DeclRefExpr 0x10514450 <col:15> 'void () noexcept' lvalue Function 0x10514240 'f' 'void () noexcept'
>
> It seems to depend on the standard, with `-std=c++17`:
>
>   |-VarDecl p 'void (*)()' cinit
>   | `-ImplicitCastExpr 'void (*)()' <NoOp>
>   |   `-ImplicitCastExpr 'void (*)() noexcept' <FunctionToPointerDecay>
>   |     `-DeclRefExpr 'void () noexcept' lvalue Function 'f' 'void () noexcept'
>
> Perhaps because pre-C++17 `noexcept` is not part of the type, so we essentially ignore it?

Oh, right, my bad. I forgot we still default to C++14 :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67112



More information about the cfe-commits mailing list