kadircet added a comment.

hi!

this seem to have regressed compilation for some valid C++ code:

  struct Bar {
    const char *name();
  };
  struct Baz {
    static Bar *method();
  };
  struct Foo {
    Foo(const char *);
  };
  
  template <typename T> void bar() { Foo _(T::method()->name()); }
  void foo() { bar<Baz>(); }

compiles fine without this change, starting with this it produces the following 
error:

  a.cc:11:55: error: expected unqualified-id
  template <typename T> void bar() { Foo _(T::method()->name()); }
                                                        ^
  a.cc:11:40: error: no matching constructor for initialization of 'Foo'
  template <typename T> void bar() { Foo _(T::method()->name()); }
                                         ^
  a.cc:12:14: note: in instantiation of function template specialization 
'bar<Baz>' requested here
  void foo() { bar<Baz>(); }
               ^
  a.cc:8:3: note: candidate constructor not viable: requires 1 argument, but 0 
were provided
    Foo(const char *);
    ^
  a.cc:7:8: note: candidate constructor (the implicit copy constructor) not 
viable: requires 1 argument, but 0 were provided
  struct Foo {
         ^
  a.cc:7:8: note: candidate constructor (the implicit move constructor) not 
viable: requires 1 argument, but 0 were provided

https://github.com/llvm/llvm-project/issues/62733 is the bug report that 
triggered the investigation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149276

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

Reply via email to