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

            Bug ID: 92434
           Summary: noexcept couldn't be deduced in function template
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nok.raven at gmail dot com
  Target Milestone: ---

template<bool b>
void foo(void(*f)() noexcept(b));

void f();

void bar()
{
    foo(&f);
}


g++ foo.cpp -std=c++17

<source>: In function 'void bar()':
<source>:8:11: error: no matching function for call to 'foo(void (*)())'
    8 |     foo(&f);
      |           ^
<source>:2:6: note: candidate: 'template<bool b> void foo(void (*)() noexcept
(b))'
    2 | void foo(void(*f)() noexcept(b));
      |      ^~~
<source>:2:6: note:   template argument deduction/substitution failed:
<source>:8:11: note:   couldn't deduce template parameter 'b'
    8 |     foo(&f);
      |       


https://godbolt.org/z/FdV3Gd

Reply via email to