public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56189] New: Infinite recursion with noexcept when instantiating function template
@ 2013-02-03 12:02 belz at kolumbus dot fi
  2013-04-16 21:16 ` [Bug c++/56189] " redi at gcc dot gnu.org
  2021-11-10  3:25 ` msebor at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: belz at kolumbus dot fi @ 2013-02-03 12:02 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56189
           Summary: Infinite recursion with noexcept when instantiating
                    function template
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: belz@kolumbus.fi


The following code:

namespace test {
   template<typename T>
   void tt(T&, T&);
}

template<typename T>
void tt(T& a, T& b) noexcept(noexcept(::test::tt(a,b)));

template<typename T>
void foo(T& x, T& y) noexcept(noexcept(tt(x, y)));

int main()
{
    int i;
    foo(i,i);
}

fails to compile with error:

Compilation finished with errors:
source.cpp:11:47: error: template instantiation depth exceeds maximum of 900
(use -ftemplate-depth= to increase the maximum) substituting 'template<class T>
void tt(T&, T&) [with T = <missing>]'
 void foo(T& x, T& y) noexcept(noexcept(tt(x, y)));
                                               ^
source.cpp:11:47:   recursively required from 'void tt(T&, T&) [with T = int]'
source.cpp:11:47:   required from 'void foo(T&, T&) [with T = int]'
source.cpp:16:12:   required from here

source.cpp:11:47: error: no matching function for call to 'tt(int&, int&)'
source.cpp:11:47: note: candidate is:
source.cpp:8:6: note: template<class T> void tt(T&, T&)
 void tt(T& a, T& b) noexcept(noexcept(::test::tt(a,b)));
      ^
source.cpp:8:6: note:   substitution of deduced template arguments resulted in
errors seen above


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

* [Bug c++/56189] Infinite recursion with noexcept when instantiating function template
  2013-02-03 12:02 [Bug c++/56189] New: Infinite recursion with noexcept when instantiating function template belz at kolumbus dot fi
@ 2013-04-16 21:16 ` redi at gcc dot gnu.org
  2021-11-10  3:25 ` msebor at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-16 21:16 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-16
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.3, 4.8.1, 4.9.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-16 21:16:08 UTC ---
name lookup in the noexcept(noexcept(...)) seems to be ignoring the namespace
qualificiation


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

* [Bug c++/56189] Infinite recursion with noexcept when instantiating function template
  2013-02-03 12:02 [Bug c++/56189] New: Infinite recursion with noexcept when instantiating function template belz at kolumbus dot fi
  2013-04-16 21:16 ` [Bug c++/56189] " redi at gcc dot gnu.org
@ 2021-11-10  3:25 ` msebor at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-11-10  3:25 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |msebor at gcc dot gnu.org
   Target Milestone|---                         |11.4
         Resolution|---                         |FIXED

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
This is accepted by GCC 12 in the default C++ mode.  It looks like it's been
accepted since g:5830f753559f25a5dabcc3507bffa611c6b575a6.

It might be worth adding the test case.

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

end of thread, other threads:[~2021-11-10  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-03 12:02 [Bug c++/56189] New: Infinite recursion with noexcept when instantiating function template belz at kolumbus dot fi
2013-04-16 21:16 ` [Bug c++/56189] " redi at gcc dot gnu.org
2021-11-10  3:25 ` msebor 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).