https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107495

--- Comment #1 from Giuseppe D'Angelo <dangelog at gmail dot com> ---
Variation of the above:

  struct Test {
      template <class = void>
      operator int *() const;
  };

  Test t;
  delete t;

also fails:

<source>: In function 'int main()':
<source>:32:12: error: default type conversion cannot deduce template argument
for 'template<class> Test::operator int*() const'
   32 |     delete t;
      |            ^
<source>:32:12: error: type 'struct Test' argument given to 'delete', expected
pointer


But here I'm not 100% sure; is there is supposed to be any template argument
deduction? Clang rejects this as well, while MSVC accepts it.

Reply via email to