https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84981
Bug ID: 84981
Summary: C++17 allows function pointers with no linkage as
template parameters but gcc errors, stating the
function has no linkage
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: xaxxon at gmail dot com
Target Milestone: ---
https://godbolt.org/g/7qE4iW
template<auto f>
void func() {
}
int main() {
constexpr auto lambda_function_pointer = +[](){};
func<lambda_function_pointer>();
}
<source>:9:35: error: 'main()::<lambda()>::_FUN' is not a valid template
argument for type 'void (*)()' because 'static constexpr void
main()::<lambda()>::_FUN()' has no linkage