alexfh added a comment.

Hi, we've started seeing compilation errors with our modularized build after 
this commit. The errors say `'SomeType' has different definitions in different 
modules`, but then point to the same definition that comes from the same 
textual header included into two modules.

The setup (which I couldn't completely isolate yet) is roughly similar to this 
(hopefully, I didn't miss any important parts):

Textual header p.h:

  #include <type_traits>
  
  #include "protobuf/generated_enum_util.h"
  ...
  
  template <typename T,
            typename =
                typename std::enable_if<proto2::is_proto_enum<T>::value>::type>
  class SomeType : E<S<T>> {
  ...
  };

Textual header a.h:

  #include <type_traits>
  
  #include "protobuf/generated_enum_util.h"
  
  namespace q {
  template <typename T,
            typename std::enable_if<::proto2::is_proto_enum<T>::value>::type>
  class X {};
  }
  
  #include "p.h"

Textual header b.h:

  // ...
  // something likely unrelated
  // ...
  #include "p.h"

Module C, c.h:

  #include "a.h"
  #include "b.h"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154324

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

Reply via email to