[Bug c++/82467] New: name mangling error when using constrained an specialized template functions

saphirahemp at yahoo dot de gcc-bugzilla@gcc.gnu.org
Sat Oct 7 21:01:00 GMT 2017


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

            Bug ID: 82467
           Summary: name mangling error when using constrained an
                    specialized template functions
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: saphirahemp at yahoo dot de
  Target Milestone: ---

Created attachment 42321
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42321&action=edit
the *i* file

It seems that the compiler produces some collisions in case of this special
constellation - template specialization for type T and constrained function
that accepts T.
 example for integer: 


template<>
     void f(int t) {} 

template<class T>
   requires requires(T t){ t + t;}
     void f(T t) {}

int main(){
   f(1);
}

will result in an error when compiling:

g++-6 -fconcepts int.cpp

/tmp/ccooj1kv.s: Assembler messages:
/tmp/ccooj1kv.s:65: Error: symbol `_Z1fIiEvT_' is already defined
/tmp/ccooj1kv.s: Error: .size expression for _Z1fIiEvT_ does not evaluate to a
constant

The same code with float instead of int will produce the same error message,
with a slightly different symbol: _Z1fIfEvT_ instead of _Z1fIiEvT_.



further informations:

the exact version of GCC and the system type;

gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 
Target: x86_64-linux-gnu


the options given when GCC was configured/built;

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
6.3.0-18ubuntu2~16.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--with-target-system-zlib --enable-objc-gc=auto --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu

the complete command line that triggers the bug;

g++-6 -fconcepts int.cpp

the compiler output (error messages, warnings, etc.);

/tmp/ccooj1kv.s: Assembler messages:
/tmp/ccooj1kv.s:65: Error: symbol `_Z1fIiEvT_' is already defined
/tmp/ccooj1kv.s: Error: .size expression for _Z1fIiEvT_ does not evaluate to a
constant


More information about the Gcc-bugs mailing list