The following simple program complains about duplicate definitions for two different template instantiations: template <typename T> void fn() {} int main() { fn<void() const>(); fn<void() const noexcept>(); } From extensive testing (I'm validating a type traits library) it seems specific to "abominable" function types differing only in the noexcept specification, so is a C++17 specific failure.
Confirmed, needs -std=c++17, works with GCC 6, fails with GCC 7. > g++-6 t.C -std=c++17 > g++-7 t.C -std=c++17 /tmp/cc9O32gK.s: Assembler messages: /tmp/cc9O32gK.s:42: Error: symbol `_Z2fnIKFvvEEvv' is already defined > c++filt _Z2fnIKFvvEEvv void fn<void () const>() > g++-6 t.C -std=c++17 -c > nm t.o 0000000000000000 W _Z2fnIKFvvEEvv 0000000000000000 T main so that it works with GCC 6 might be because of another bug (the instantiation is missing).
Bisection points to r241958 but that is nonsense, so I suspect r241944.
(In reply to Marek Polacek from comment #2) > Bisection points to r241958 but that is nonsense, so I suspect r241944. Yes that would have been my guess.
Author: jason Date: Sat Jun 17 02:28:06 2017 New Revision: 249321 URL: https://gcc.gnu.org/viewcvs?rev=249321&root=gcc&view=rev Log: PR c++/80614 - Wrong mangling for C++17 noexcept type * mangle.c (write_type): Put the eh spec back on the function type. Added: trunk/gcc/testsuite/g++.dg/cpp1z/noexcept-type16.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/mangle.c
Author: jason Date: Sat Jun 17 02:33:28 2017 New Revision: 249327 URL: https://gcc.gnu.org/viewcvs?rev=249327&root=gcc&view=rev Log: PR c++/80614 - Wrong mangling for C++17 noexcept type * mangle.c (write_type): Put the eh spec back on the function type. Added: branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/noexcept-type16.C Modified: branches/gcc-7-branch/gcc/cp/ChangeLog branches/gcc-7-branch/gcc/cp/mangle.c
Fixed.