[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2017-01-18 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Markus Trippelsdorf  ---
Fixed.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2017-01-18 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #13 from Markus Trippelsdorf  ---
Author: trippels
Date: Wed Jan 18 08:49:11 2017
New Revision: 244567

URL: https://gcc.gnu.org/viewcvs?rev=244567=gcc=rev
Log:
Fix PR70182 -- missing "on" in mangling of unresolved operators

The ABI says:


   ::= [gs] 
   ::= sr  
   ::= srN  + E

   ::= [gs] sr + E 


   ::= 
   ::= on 
   ::= on  
   ::= dn 

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2017-01-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #12 from Jason Merrill  ---
(In reply to Markus Trippelsdorf from comment #10)
> Looks like:
> 
> diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
> index 5d38373765bb..9d04c35d1f62 100644
> --- a/gcc/cp/mangle.c
> +++ b/gcc/cp/mangle.c
> @@ -2653,6 +2653,8 @@ write_template_args (tree args)
>  static void
>  write_member_name (tree member)
>  {
> +  if (IDENTIFIER_OPNAME_P (member))
> +write_string ("on");
>if (identifier_p (member))
>  write_unqualified_id (member);
>else if (DECL_P (member))
> 
> might actually work.

That makes sense.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-15 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #11 from Ian Lance Taylor  ---
g++ has generated (what I think is) the incorrect mangling since at least GCC
4.7, so this probably needs to be controlled by yet another -fabi-version
value.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-15 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

Markus Trippelsdorf  changed:

   What|Removed |Added

   Keywords||wrong-code

--- Comment #10 from Markus Trippelsdorf  ---
Looks like:

diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 5d38373765bb..9d04c35d1f62 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2653,6 +2653,8 @@ write_template_args (tree args)
 static void
 write_member_name (tree member)
 {
+  if (IDENTIFIER_OPNAME_P (member))
+write_string ("on");
   if (identifier_p (member))
 write_unqualified_id (member);
   else if (DECL_P (member))

might actually work. 
But g++.dg/dfp/mangle-1.C, g++.dg/abi/mangle13.C and g++.dg/abi/mangle37.C
would need adjustments.

Jason?

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-14 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #9 from Ian Lance Taylor  ---
Yes.  The relevant bits in the mangling ABI are


   ::= [gs] 
   ::= sr  
   ::= srN  + E

   ::= [gs] sr + E 


   ::= 
   ::= on 
   ::= on  
   ::= dn 

 ::= 

 ::=  [  ]

 ::=  


srT_ must be sr  , where the T_ is the
, so it must be followed by . 
 can only start with a digit or "on" or "dn".  So I see
no way that srT_cl could meet the requirements of the ABI.  It has to be
srT_oncl, where the "on" is needed to indicate that "cl" is an operator name.

That said, GCC is not crazy, as there is no other way to parse this.  The
result is unambiguous.  But it doesn't meet the documented standard.

I think the bug may be that cp/mangle.c:write_member_name needs to check
IDENTIFIER_OPNAME_P and print "on" if it is true, as write_expression does. 
But I'm not sure.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-14 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #8 from Markus Trippelsdorf  ---
(In reply to Ian Lance Taylor from comment #7)
> For the record, I've fixed these cases in
> github.com/ianlancetaylor/demangle.  Looking at the patch there should show
> how to fix it elsewhere.
> 
> https://github.com/ianlancetaylor/demangle/commit/
> 33b3934fafc5026e0b38854a7976b91ad0014a02

Thanks. So are you saying that gcc's mangling
_ZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSC_OS6_
instead of
_ZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcSC_OS6_
may be a wrong code bug?

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-14 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

Ian Lance Taylor  changed:

   What|Removed |Added

 CC||ian at airs dot com

--- Comment #7 from Ian Lance Taylor  ---
For the record, I've fixed these cases in github.com/ianlancetaylor/demangle. 
Looking at the patch there should show how to fix it elsewhere.

https://github.com/ianlancetaylor/demangle/commit/33b3934fafc5026e0b38854a7976b91ad0014a02

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #6 from Markus Trippelsdorf  ---
https://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp
https://github.com/ianlancetaylor/demangle

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #5 from Markus Trippelsdorf  ---
(In reply to Andrew Pinski from comment #4)
> >Ian's go demangler and the libcxxabi demangler also are unable to demangle 
> >these  symbols.
> 
> Because they are all the same code ...

No, they are not. These are all independent implementations.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #4 from Andrew Pinski  ---
>Ian's go demangler and the libcxxabi demangler also are unable to demangle 
>these  symbols.

Because they are all the same code ...

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||iant at google dot com

--- Comment #3 from Markus Trippelsdorf  ---
trippels@gcc2-power8 ~ % cat down.ii
namespace std {
template  struct integral_constant {
  static constexpr _Tp value = 0;
};
template  struct conditional;
template  struct A;
template 
struct A<_B1, _B2> : conditional<_B1>::type {};
struct B : integral_constant {};
template  struct enable_if { typedef int type; };
template  struct conditional { typedef B type; };
struct type_info;
template  struct function;
template  struct _Base_manager {
  static int _M_manager() { ; }
};
template  struct C;
template 
struct C<_Res(_ArgTypes...), _Functor> : _Base_manager<_Functor> {};
template  using __check_func_return_type = int;
template 
struct function<_Res(_ArgTypes...)> {
  template 
  using _Callable = A<_Functor, __check_func_return_type<_Functor, _Res>>;
  template 
  using _Requires = typename enable_if<_Cond::value>::type;
  template , void>>
  function(_Functor);
};
template 
template 
function<_Res(_ArgTypes...)>::function(_Functor) {
  C<_Res(), _Functor>::_M_manager;
}
}
struct D {
  static const int value = 0;
};
namespace boost {
template  struct F { typedef T2 type; };
namespace function_types {
template  struct G;
template  struct H : G {};
template 
struct G {
  typedef D function_arity;
};
template 
struct function_arity : F::function_arity>::type {};
}
}
namespace folly {
namespace detail {
void addBenchmarkImpl(int, int, std::function);
}
template 
typename std::enable_if::value == 2>::type
addBenchmark(const char *, const char *, Lambda &&) {
  auto execute = [](unsigned) {};
  detail::addBenchmarkImpl(0, 0, execute);
}
}
int follyBenchmarkUnused2(folly::addBenchmark("", "", [](int) {}));

trippels@gcc2-power8 ~ % clang++ -w -std=c++14 down.ii -c
trippels@gcc2-power8 ~ % nm -C down.o
 t __cxx_global_var_init
 B follyBenchmarkUnused2
0070 t _GLOBAL__sub_I_down.ii
 U .TOC.
 t
_ZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcS8_OS3_
 U folly::detail::addBenchmarkImpl(int, int, std::function)
0090 t
_ZNSt13_Base_managerIZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcS9_OS4_EUljE_E10_M_managerEv
0070 t
_ZNSt8functionIFivEEC2IZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcSC_OS7_EUljE_iEES7_

trippels@gcc2-power8 ~ % g++ -w -std=c++14 down.ii -c
trippels@gcc2-power8 ~ % nm -C down.o
 B follyBenchmarkUnused2
014c t _GLOBAL__sub_I_follyBenchmarkUnused2
 U .TOC.
00ac t __static_initialization_and_destruction_0(int, int)
 t
_ZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSC_OS6_
 U folly::detail::addBenchmarkImpl(int, int, std::function)
007c t
_ZNSt8functionIFivEEC1IZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSG_OSA_EUljE_iEESA_
007c t
_ZNSt8functionIFivEEC2IZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSG_OSA_EUljE_iEESA_

Ian's go demangler and the libcxxabi demangler also are unable to demangle
these  symbols.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread twoh at fb dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

--- Comment #2 from Taewook Oh  ---
Here is a link to the preprocessed text: http://paste.ubuntu.com/15346235/

As I wrote in the description, it seems pretty clear that demangler applies an
incorrect rule to demangle expression. For "srT_oncl", if demangler applies the
correct rule

 ::= sr  ,

then "T_" can be processed by rule 

 ::= T_

and "oncl" can be processed by

 ::= on  
 ::= cl  # ().

GCC generates a slightly different name
(_ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkIUljE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSG_OSA_EUljE_E9_M_invokeERKSt9_Any_dataj)
but still cannot be demangled by c++filt.

[Bug c++/70182] c++filt fails to demangle _ZNSt17_Function_handlerIFSt4pairImjEjEZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typ

2016-03-11 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2016-03-11
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf  ---
Could you please attach a preprocessed file of the source that shows this
issue.
The snipped you have posted is not enough.

No demangler that I've tested could demangle the symbol, so it might well be 
a clang mangler bug.