This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Increase -ftemplate-depth default


Hi!

Current -ftemplate-depth default is IMHO way too low, e.g. kdevelop hits is
without problem when using lots of << operators (simplified testcase like:

template <class T>
class foo
{
public:
        foo<T>& operator <<(const T&x) { return *this; }
};

int main(int argc, char **argv)
{
        foo <char *> baz;
        baz << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "0"
            << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "0"
            << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "0"
            << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "0"
            << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "0"
            << "1";
}
).  The comment above the default sais it is just an arbitrary value, is
there some reason to keep it that low?

2002-01-08  Jakub Jelinek  <jakub@redhat.com>

	* decl2.c (max_tinst_depth): Increase default limit to 500.

--- gcc/cp/decl2.c.jj	Tue Jan  8 18:25:01 2002
+++ gcc/cp/decl2.c	Tue Jan  8 23:05:21 2002
@@ -382,7 +382,7 @@ int flag_use_cxa_atexit;
    arbitrary, but it exists to limit the time it takes to notice
    infinite template instantiations.  */
 
-int max_tinst_depth = 50;
+int max_tinst_depth = 500;
 
 /* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc.  */
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]