AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only

1540-0701 (S) The limit on nested template instantiations has been exceeded

  • 1.  1540-0701 (S) The limit on nested template instantiations has been exceeded

    Posted Mon June 22, 2009 02:13 AM

    Originally posted by: SystemAdmin


    > uname -a
    AIX ilibm016 3 5 0004F43AD400

    > /usr/vacpp/bin/xlC_r -qversion
    IBM XL C/C++ Enterprise Edition V8.0 for AIX
    Version: 08.00.0000.0000

    Here is some program

    • prog.cpp ---
    template <int N>
    int foo()
    {
    return (foo<N-1>() + 2);
    }

    template
    int foo<0>()
    {
    return 0;
    }

    int main()
    {
    int value = foo<300>();
    return value;
    }


    Compilation:

    > /usr/vacpp/bin/xlC_r -q64 -qwarn64 prog.cpp
    "prog.cpp", line 2.5: 1540-0701 (S) The limit on nested template instantiations
    has been exceeded while instantiating "int foo<250>()".

    ============================

    Question-1. Is there any compilation option or pragma that enables the user
    to increase the template-related recursion deep/limit?

    Question-2. Does any xlC's description contains the exact value of that limit?

    Thanks,

    Alex Vinokur
    #AIX-Forum