[PATCH] D136554: Implement CWG2631

Jordan Rupprecht via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 16:47:25 PST 2022


rupprecht added a comment.

Here's a well-formed reproducer:

  struct MyStringView {
    MyStringView(const char *);
  };
  
  struct SourceLocation {
    static SourceLocation current(const char * = __builtin_FILE(),
                                  unsigned int = __builtin_LINE());
  };
  
  template <typename T>
  int Wrap(T);
  
  template <typename>
  struct Fixed {
    using name = MyStringView;
  };
  
  struct Metadata {
    Metadata(SourceLocation = SourceLocation::current());
  };
  
  struct Name {
    Name(int *);
  };
  
  template <typename... Fields>
  struct C {
    static C New(Name, typename Fixed<Fields>::name..., Metadata);
  };
  struct X {
    int &x();
  };
  struct Foo {
    X x;
    int i = Wrap(C<int, int>::New(&x.x(), "", "", Metadata()));
  };
  void func() { new Foo{}; }


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