[PATCH] D136554: Implement CWG2631

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 07:08:46 PST 2022


cor3ntin reopened this revision.
cor3ntin added a comment.
This revision is now accepted and ready to land.

There is still an ODR issue which caused linkers errors
I think I managed to reduce the issue to

  template <typename T>
  struct function_ref {
      function_ref(auto) {}
  };
  
  struct S {
      function_ref<int> X = nullptr;
  };
  
  void Do(S = {}) {
  }
  
  int main() {
      Do();
  }

We mark nullptr odr used but that does not mark `function_ref<int>::function_ref()` ODR used.
We should make sure that's properly marked once the constructor call is resolved.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136554



More information about the cfe-commits mailing list