Bug 94415

Summary: Implement DR 2237: Can a template-id name a constructor?
Product: gcc Reporter: Marek Polacek <mpolacek>
Component: c++Assignee: Marek Polacek <mpolacek>
Status: RESOLVED FIXED    
Severity: normal CC: webrown.cpp
Priority: P3 Keywords: accepts-invalid, patch
Version: 10.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2020-03-30 00:00:00
Bug Depends on:    
Bug Blocks: 94404    

Description Marek Polacek 2020-03-30 23:16:29 UTC
Implement <https://eel.is/c++draft/diff.cpp17.class#2>:

template<class T>
struct A {
  A<T>();           // error: simple-template-id not allowed for constructor
  A(int);           // OK, injected-class-name used
  ~A<T>();          // error: simple-template-id not allowed for destructor
};

Note this is not a DR against C++17, the above is only ill-formed in C++20 onwards.
Comment 1 Marek Polacek 2020-04-04 23:33:47 UTC
Patch posted: <https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543301.html>
Comment 2 Marek Polacek 2020-07-14 19:15:36 UTC
Fixed in r11-532-g4b38d56dbac6742b038551a36ec80200313123a1.