Issue 108732
Summary Behaviour of implicit inline member functions and extern "C++" in a module
Labels new issue
Assignees
Reporter kamrann
    It looks to me as if Clang is not doing the correct thing in the following case:
```
export module mod;

extern "C++" {

  class C
  {
  public:
    bool foo() const
    {
      return true;
    }
 };

}
```

>From what I can see, Clang is suppressing implicit `inline` for `foo`, but the [standard states](https://eel.is/c++draft/class.mfct#1) that implicit `inline` should apply to anything attached to the global module, which includes anything inside a module TU that is enclosed in `extern "C++"`. I checked also with cppinsights.com, which actually suggests Clang is applying the rule correctly, but my experience is otherwise so I'm guessing that either cppinsights is just wrong, or the issue is with the information not being forwarded correctly to the codegen phase.

The result is heaps of multiple definition linker errors when trying to combine include and import usage.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to