[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2021-12-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43113

--- Comment #7 from Andrew Pinski  ---
For the original case in comment #0 we get in GCC 5+:
: In instantiation of 'struct A::S>::S>::S>::S>':
:5:11:   recursively required from 'struct A::S>'
:5:11:   required from 'struct A'
:8:12:   required from here
:5:11: fatal error: template instantiation depth exceeds maximum of 5
(use -ftemplate-depth= to increase the maximum)
   A < S > ht;
   ^

[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

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

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #6 from Martin Liška  ---
I came to a similar test-case, which is an invalid code. But maybe a different
kind of issue:

$ cat error-reduce.ii
template  struct vec
{
  static vec plus_negates struct repeat_factor;
vec < repeat_factor > repeat_factor_vec fini_reassoc (
{
  plus_negates

$ gcc error-reduce.ii

...

error-reduce.ii:4:27: fatal error: template instantiation depth exceeds maximum
of 900 (use -ftemplate-depth= to increase the maximum)
 vec < repeat_factor > repeat_factor_vec fini_reassoc (
   ^

[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2014-09-30 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43113
Bug 43113 depends on bug 16564, which changed state.

Bug 16564 Summary: g++ seems to go into an infinite loop after errors
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16564

   What|Removed |Added

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


[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2014-05-20 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43113

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

 CC||paolo.carlini at oracle dot com
 Depends on||16564

--- Comment #5 from Manuel López-Ibáñez manu at gcc dot gnu.org ---
I don't want to mark it as a duplicate because PR16564 is a bit more complex. 

I think this one should be easier to fix. We could always print:

pr43113.C:7:11: error: template instantiation depth exceeds maximum of 10 (use
-ftemplate-depth= to increase the maximum) instantiating ‘struct
A[...]AB::S[...]::S’
pr43113.C:7:11:   recursively instantiated from ‘AAB::S’
pr43113.C:7:11:   instantiated from ‘AB’
pr43113.C:10:20:   instantiated from here
pr43113.C:7:11: error: ‘AS::ht’ has incomplete type

[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2010-04-28 Thread manu at gcc dot gnu dot org


--- Comment #4 from manu at gcc dot gnu dot org  2010-04-28 08:46 ---
The output is now:

$ cc1plus pr43113.C -ftemplate-depth=10

pr43113.C:7:11: error: template instantiation depth exceeds maximum of 10 (use
-ftemplate-depth= to increase the maximum) instantiating ‘struct
AAAB::S::S::S::S::S::S::S::S::S::S’
pr43113.C:7:11:   recursively instantiated from ‘AAB::S’
pr43113.C:7:11:   instantiated from ‘AB’
pr43113.C:10:20:   instantiated from here

pr43113.C:7:11: error: ‘A template-parameter-1-1 ::ht’ has incomplete type
pr43113.C:5:8: error: declaration of ‘struct
AAAB::S::S::S::S::S::S::S::S::S::S’

The template-parameter-1-1 is wrong, not sure what is going on there.

We could avoid the two long lines by not printing the full instantiation, only
the first recursion, that is, just 'struct AAB::S'


-- 


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



[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2010-02-19 Thread manu at gcc dot gnu dot org


--- Comment #2 from manu at gcc dot gnu dot org  2010-02-20 00:36 ---
This is a different case than 9335.

Comeau does not handle this well either, so I am not sure how this case could
be solved.


-- 

manu at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||manu at gcc dot gnu dot org
 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


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



[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2010-02-19 Thread manu at gcc dot gnu dot org


--- Comment #3 from manu at gcc dot gnu dot org  2010-02-20 00:36 ---
But this is confirmed in GCC 4.5


-- 

manu at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-02-20 00:36:39
   date||


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



[Bug c++/43113] too long diagnostics in some cases of recursive template instantiation

2010-02-18 Thread paolo dot carlini at oracle dot com


--- Comment #1 from paolo dot carlini at oracle dot com  2010-02-18 14:18 
---


*** This bug has been marked as a duplicate of 9335 ***


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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