public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/94326] New: g++: error: pack.ii: ‘-fcompare-debug’ failure (length)
@ 2020-03-25 13:09 marxin at gcc dot gnu.org
  2020-03-25 13:09 ` [Bug debug/94326] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-25 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94326
           Summary: g++: error: pack.ii: ‘-fcompare-debug’ failure
                    (length)
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

This one is very old (at least GCC 4.8.0):

$ cat pack.ii
template <typename = int> class A {
  const int &m_fn1() { return 0; }

public:
  template <typename _Kt> void m_fn2(_Kt) { m_fn1(); }
};
class B {
  A<> _M_t;

public:
  template <typename _Kt> auto m_fn3(_Kt p1) -> decltype(_M_t.m_fn2(p1)) {
    _M_t.m_fn2(p1);
  }
};
struct C {};
void operator<(C, int) {
  B a;
  a.m_fn3(C{});
}

$ g++ pack.ii -c -fcompare-debug -std=c++11
pack.ii: In instantiation of ‘const int& A< <template-parameter-1-1> >::m_fn1()
[with <template-parameter-1-1> = int]’:
pack.ii:5:45:   required from ‘void A< <template-parameter-1-1> >::m_fn2(_Kt)
[with _Kt = C; <template-parameter-1-1> = int]’
pack.ii:12:15:   required from ‘decltype
(((B*)this)->B::_M_t.A<>::m_fn2<_Kt>(p1)) B::m_fn3(_Kt) [with _Kt = C; decltype
(((B*)this)->B::_M_t.A<>::m_fn2<_Kt>(p1)) = void]’
pack.ii:18:14:   required from here
pack.ii:2:31: warning: returning reference to temporary [-Wreturn-local-addr]
    2 |   const int &m_fn1() { return 0; }
      |                               ^
g++: error: pack.ii: ‘-fcompare-debug’ failure (length)

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

end of thread, other threads:[~2020-03-27 20:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 13:09 [Bug debug/94326] New: g++: error: pack.ii: ‘-fcompare-debug’ failure (length) marxin at gcc dot gnu.org
2020-03-25 13:09 ` [Bug debug/94326] " marxin at gcc dot gnu.org
2020-03-25 15:27 ` marxin at gcc dot gnu.org
2020-03-26 12:30 ` [Bug c++/94326] " jakub at gcc dot gnu.org
2020-03-26 12:31 ` jakub at gcc dot gnu.org
2020-03-26 13:58 ` jakub at gcc dot gnu.org
2020-03-26 14:05 ` jakub at gcc dot gnu.org
2020-03-27  9:05 ` cvs-commit at gcc dot gnu.org
2020-03-27 20:19 ` jakub 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).