Title
Redundant constraints on matching function template declarations
Status
open
Section
6.6 [basic.link]
Submitter
Vlad Serebrennikov

Created on 2024-10-27.00:00:00 last changed 3 weeks ago

Messages

Date: 2024-10-27.00:00:00

(From submission #630.)

Subclause 6.6 [basic.link] paragraph 11 specifies:

For any two declarations of an entity E:
  • ...
  • If one declares E to be a function template or a (partial specialization of a) variable template, the other shall declare E to be one with an equivalent template-head and type.
  • ...

However, two function template declarations can only ever declare the same entity if they correspond (6.6 [basic.link] paragraph 8), which requires they have the same template-heads (6.4.1 [basic.scope.scope] paragraph 4). The "equivalent type" requirement covers differences in noexcept, which is (intentionally) not covered by "corresponding signatures".

Possible resolution:

Change in 6.6 [basic.link] paragraph 11 as follows:

For any two declarations of an entity E:
  • ...
  • If one declares E to be a function template, the other shall declare E to be one with an equivalent type.
  • If one declares E to be a function template or a (partial specialization of a) variable template, the other shall declare E to be one with an equivalent template-head and type.
  • ...
History
Date User Action Args
2024-10-27 00:00:00admincreate