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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2011-01-27 10:56:51         |2019-3-27

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang edn EDG both accept the examples in comment 1 and comment 2, producing
the same symbols.

For comment 1 they emit _Z1gIiE1NIXszcl1fcvT__ELA1_KcEEEERKS1_
For comment 2 they emit _Z1gIiE1NIXszcl1fIT_ELA1_KcEEEERKS1_

They both reject comment 5.

Clang says:

c5.cc:4:28: error: definition with same mangled name
'_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE' as another definition
template <typename T> void g(T, N<f((const T*)"2")>) { }
                           ^
c5.cc:3:28: note: previous definition is here
template <typename T> void g(T, N<f((const T*)"1")>) { }
                           ^
1 error generated.

And EDG says:

eccp: diagnostics generated from compilation of c5.int.c:
c5.cc:4:96: error: conflicting types for ‘_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE’
 template <typename T> void g(T, N<f((const T*)"2")>) { }
                                                                               
                ^                                  
c5.cc:3:96: note: previous declaration of ‘_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE’
was here
 template <typename T> void g(T, N<f((const T*)"1")>) { }
                                                                               
                ^                                  
c5.cc: In function ‘main’:
c5.cc:8:49: error: incompatible type for argument 2 of
‘_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE’
   g('1', N<'1'>());
                                                 ^          
c5.cc:4:138: note: expected ‘struct _Z1NILi50EE’ but argument is of type
‘struct _Z1NILi49EE’
 template <typename T> void g(T, N<f((const T*)"2")>) { }
                                                                               
                                                          ^                 
c5.cc: At top level:
c5.cc:4:89: error: conflicting types for ‘_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE’
 template <typename T> void g(T, N<f((const T*)"2")>) { }
                                                                               
         ^                                  
c5.cc:3:89: note: previous definition of ‘_Z1gIcEvT_1NIXcl1fcvPKS0_LA2_KcEEEE’
was here
 template <typename T> void g(T, N<f((const T*)"1")>) { }
                                                                               
         ^                                  
eccp: end of diagnostics from compilation of c5.int.c
eccp: gcc compilation of c5.int.c returned an exit status of 1

Reply via email to