public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60935] New: Endless loop when compiling a recursive function
@ 2014-04-23 11:04 miskcoo at gmail dot com
  2021-07-22 19:50 ` [Bug c++/60935] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: miskcoo at gmail dot com @ 2014-04-23 11:04 UTC (permalink / raw)
  To: gcc-bugs

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;
}


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

* [Bug c++/60935] Endless loop when compiling a recursive function
  2014-04-23 11:04 [Bug c++/60935] New: Endless loop when compiling a recursive function miskcoo at gmail dot com
@ 2021-07-22 19:50 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|accepts-invalid, diagnostic |compile-time-hog

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For me, if I change operator % to return correctly, it is not an endless loop,
just takes a long long time to error out.
Also clang takes just as long to error out.

I can get GCC to error out quickly with -ftemplate-depth=20 .


I don't think there might be anything here to fix really.

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

end of thread, other threads:[~2021-07-22 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 11:04 [Bug c++/60935] New: Endless loop when compiling a recursive function miskcoo at gmail dot com
2021-07-22 19:50 ` [Bug c++/60935] " pinskia at gcc dot gnu.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).