nridge added a comment.

Thanks! I reduced it further to:

  template <typename>
  class function {
  public:
    template <typename F>
    function(F) {}
  };
  
  template <typename M>
  void Foo(M, function<void()> = [](){});
  
  void Bar() {
    Foo(42);
    Foo(42.0);
  }

with gcc 7, this gives:

  /tmp/cccKjL8O.s: Assembler messages:
  /tmp/cccKjL8O.s:76: Error: symbol `_ZN8functionIFvvEEC2IUlvE_EET_' is already 
defined

I still don't understand this error, but it seems to be related to the lambda 
that appears as a default argument in a function that gets instantiated 
multiple times (and with the default argument value not dependent on the 
function's template parameter), so I think that gives us some idea of where to 
try workarounds.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105457/new/

https://reviews.llvm.org/D105457

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to