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

            Bug ID: 60935
           Summary: Endless loop when compiling a recursive function
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: miskcoo at gmail dot com

[g++ 4.8.2 on Arch Linux (Linux version 3.14.1-1-ARCH) ]
The g++ compiler is in an endless loop when I compile the following code, but
clang++ will give a compile error.


namespace strange
{
    template<typename T1, typename T2>
    struct strange_pack {};

    struct strange_class {};

    template<typename T1, typename T2>
    strange_pack<T1, T2>
        operator % (T1, T2) {}

    template<typename T1, typename T2>
    void strange_recursive(T1 a, T2 b)
    {
        strange_recursive(b, a % b);
    }
}

int main()
{
    strange::strange_class a, b;
    strange::strange_recursive(a, b);
    return 0;
}

Reply via email to