Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
23
-
b17
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8332171 | 22.0.2 | Jan Kratochvil | P4 | Resolved | Fixed | b06 |
JDK-8332291 | 21.0.4 | Jan Kratochvil | P4 | Resolved | Fixed | b04 |
JDK-8332384 | 17.0.12 | Jan Kratochvil | P4 | Resolved | Fixed | b04 |
Description
Within the definition scope of a class template, the identifier for that template can be used without any template parameters. Only if some other set of parameters is needed do the parameters need to be explicit.
For example, comparing this with an object of the same type doesn't need to provide template parameters for the parameter type. It's even a little bit beneficial to not do so, since renaming a template parameter requires fewer ancillary changes.
(*) There are several cases where a constructor declaration has a template parameter list. This isn't currently needed, and seems to not even be valid syntax in later C++ versions. (I discovered this while experimenting with using -std:c++20.)
Attachments
Issue Links
- backported by
-
JDK-8332171 Remove unnecessary template parameter lists in GrowableArray
- Resolved
-
JDK-8332291 Remove unnecessary template parameter lists in GrowableArray
- Resolved
-
JDK-8332384 Remove unnecessary template parameter lists in GrowableArray
- Resolved
- relates to
-
JDK-8331352 error: template-id not allowed for constructor/destructor in C++20
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/d17fa034
-
Commit openjdk/jdk21u-dev/fdb82f42
-
Commit openjdk/jdk22u/ccef462e
-
Commit openjdk/jdk/3d228380
-
Review openjdk/jdk17u-dev/2466
-
Review openjdk/jdk21u-dev/564
-
Review openjdk/jdk22u/197
-
Review openjdk/jdk/18480