[Bug c++/52036] C++11 allows template parameters to have internal linkage

xaxxon at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Feb 24 07:08:00 GMT 2018


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

zac <xaxxon at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xaxxon at gmail dot com

--- Comment #12 from zac <xaxxon at gmail dot com> ---
Any update?  

https://godbolt.org/g/7qE4iW


template<auto f>
void func() {
}
void g();
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


More information about the Gcc-bugs mailing list