https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100681

            Bug ID: 100681
           Summary: [[noreturn]] attribute can be applied to parameters of
                    function type with strange results
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix.von.s at posteo dot de
  Target Milestone: ---

Created attachment 50845
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50845&action=edit
Sample program

Attached is a code sample which G++ accepts and all other compilers I tested
reject. When the `never::invoke` line is uncommented, compilation fails with a
message naming the type of func as `R(Args ...) volatile`, which is an
abominable function type. There doesn’t seem to be a real way to use the
method.

Expected behaviour: the code is rejected in both versions, just like in other
compilers.

Desired behaviour: the code is accepted in both versions, with the [[noreturn]]
attribute applied to func as if it were a function invoked directly.

Reply via email to