public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43113]  New: too long diagnostics in some cases of recursive template instantiation
@ 2010-02-18 13:30 zsojka at seznam dot cz
  2010-02-18 14:19 ` [Bug c++/43113] " paolo dot carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2010-02-18 13:30 UTC (permalink / raw)
  To: gcc-bugs

-------- testcase.cpp --------
template < typename >
struct A {
  struct S;
  A < S > ht;
};

struct B : A < B > {};
------------------------------

without -ftemplate-depth, it instantiates templates up do default depth, giving
760KiB of diagnostics for this simple testcase (for 4.5.0)

this is output with -ftemplate-depth-5:
$ g++ testcase.cpp -ftemplate-depth-5
testcase.cpp:4: error: template instantiation depth exceeds maximum of 5 (use
-ftemplate-depth-NN to increase the maximum) instantiating 'struct
A<A<A<A<A<A<B>::S>::S>::S>::S>::S>'
testcase.cpp:4:   instantiated from 'A<A<A<A<A<B>::S>::S>::S>::S>'
testcase.cpp:4:   instantiated from 'A<A<A<A<B>::S>::S>::S>'
testcase.cpp:4:   instantiated from 'A<A<A<B>::S>::S>'
testcase.cpp:4:   instantiated from 'A<A<B>::S>'
testcase.cpp:4:   instantiated from 'A<B>'
testcase.cpp:7:   instantiated from here

testcase.cpp:4: error: 'A< <template-parameter-1-1> >::ht' has incomplete type
testcase.cpp:2: error: declaration of 'struct
A<A<A<A<A<A<B>::S>::S>::S>::S>::S>'

------------------------------

all tested gcc versions behave the same - 2.95, 3.2.3, 3.3.6, 3.4.6, 4.0.4,
4.1.2, 4.2.4, 4.3.4, 4.4.3, 4.5.0 (with the exception that 2.95 bails out at
the end, and 3.2.3 and 2.95 need quite long time for even template depth 20)


-- 
           Summary: too long diagnostics in some cases of recursive template
                    instantiation
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-16 23:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43113-4@http.gcc.gnu.org/bugzilla/>
2014-05-20 16:06 ` [Bug c++/43113] too long diagnostics in some cases of recursive template instantiation manu at gcc dot gnu.org
2014-09-30 17:36 ` paolo.carlini at oracle dot com
2021-12-16 23:09 ` pinskia at gcc dot gnu.org
2010-02-18 13:30 [Bug c++/43113] New: " zsojka at seznam dot cz
2010-02-18 14:19 ` [Bug c++/43113] " paolo dot carlini at oracle dot com
2010-02-20  0:36 ` manu at gcc dot gnu dot org
2010-02-20  0:36 ` manu at gcc dot gnu dot org
2010-04-28  8:46 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).