Bug 94415 - Implement DR 2237: Can a template-id name a constructor?
Summary: Implement DR 2237: Can a template-id name a constructor?
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Marek Polacek
URL:
Keywords: accepts-invalid, patch
Depends on:
Blocks: c++-core-issues
  Show dependency treegraph
 
Reported: 2020-03-30 23:16 UTC by Marek Polacek
Modified: 2020-07-14 19:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-03-30 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.