[Bug c++/55581] [C++11] Too-eager instantiation with decltype

2024-04-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55581

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=49118
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Andrew Pinski  ---
clang starting in 4.0 has much worse behavior than GCC in that it crashes.

[Bug c++/55581] [C++11] Too-eager instantiation with decltype

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55581

--- Comment #3 from Andrew Pinski  ---
so these days clang explodes on this testcase.

[Bug c++/55581] [C++11] Too-eager instantiation with decltype

2013-02-13 Thread jason at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55581



Jason Merrill  changed:



   What|Removed |Added



 CC||jason at gcc dot gnu.org



--- Comment #2 from Jason Merrill  2013-02-13 
18:56:17 UTC ---

13.5.6 says, "An expression x->m is interpreted as (x.operator->())->m for a

class object x of type T if T::operator->() exists and if the operator is

selected as the best match function by the overload resolution mechanism

(13.3)."



So by repeated application of this rule a->x becomes

a.operator->().operator->().operator->().operator->()...->x, which does in fact

require 1 instantiations of mooch to evaluate.  Given how long clang takes

to compile this testcase, it seems that they are also doing all the

instantiations, they just aren't counting them as nested and so if the

terminating specialization isn't present it will keep going until resources are

exhausted.



It's not clear to me that this behavior is better than flagging the extreme

chain as G++ does; we used to do the same as clang, but changed in response to

bug 49118.