This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.6.3
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2012-04-14
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
         Depends on|                            |51650
     Ever Confirmed|0                           |1
            Summary|ICE producing debug info    |[4.7/4.8 regression] ICE
                   |for c++11 code using        |producing debug info for
                   |templates/decltype/lambda   |c++11 code using local
                   |                            |class as template argument

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2012-04-14 21:22:53 UTC ---
Neither decltype nor lambda are needed for this bug, just use of a local type
as a template parameter:

template <typename T>
struct C { };

template <typename V>
void f(V v) {
  struct B {};
  C<B> c;
}

template <typename T>
void g(T t) {
  struct A { } a;
  f (a);
}

struct D {
  void h() { g(0); }
};

This seems to be a result of the fix for PR 51650; we want to emit debug info
about C<B>, so B ends up on the limbo list.  When we walk the limbo list we
decide to emit f<A>, so A ends up on the limbo list.  But it gets added to the
beginning, so the list walk never sees it, and when we get around to emitting
the debug info for f<A> it can't find the A to refer to, and ICEs.

Before the patch for 51650 we didn't try to emit f<A> to be context for B.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]