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++/69889] New: [6 Regression] ICE: in assign_temp, at function.c:961


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

            Bug ID: 69889
           Summary: [6 Regression] ICE: in assign_temp, at function.c:961
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bbannier+gcc_bugs at gmail dot com
  Target Milestone: ---

I see an internal compiler error with the following code (reduced from actual
production code that passes with g++-5.3.0).

% cat log.ii
template <typename F> struct Tag {
  static void fp() { f()(0); }
  static F f() {}
};

struct Dispatch {
  template <typename F> Dispatch(F&&) : f(Tag<F>::fp) {}
  void (*f)();
};

struct Empty { Empty(Empty&&); };

struct Value {
  Value();
  template <typename U> Value(U);
  void call(Dispatch);
  Empty e;
};

struct EmptyValue {
  EmptyValue(EmptyValue&&);
  EmptyValue();
};

struct User {
  User() {
    Value().call([](Value) { return EmptyValue(); });
  }
};

User user;


% g++ --std=c++11 -S log.ii
log.ii: In static member function âstatic EmptyValue
User::User()::<lambda(Value)>::_FUN(Value)â:
log.ii:27:51: internal compiler error: in assign_temp, at function.c:961
     Value().call([](Value) { return EmptyValue(); });
                                                   ^

log.ii:27:51: internal compiler error: Abort trap: 6
g++: internal compiler error: Abort trap: 6 (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

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