Title
Variable templates in the ODR
Status
c++20
Section
6.3 [basic.def.odr]
Submitter
Richard Smith

Created on 2019-10-10.00:00:00 last changed 7 months ago

Messages

Date: 2019-10-15.00:00:00

Proposed resolution (October, 2019):

There can be more than one definition of a

  • class type (Clause Clause 11 [class]),

  • enumeration type (9.7.1 [dcl.enum]),

  • inline function or variable with external linkage (9.2.8 [dcl.inline]),

  • inline variable with external linkage (9.2.8 [dcl.inline]),

  • class template (Clause Clause 13 [temp]),

  • non-static function template (13.7.7 [temp.fct]),

  • concept (13.7.9 [temp.concept]),

  • static data member of a class template (13.7.2.5 [temp.static]),

  • member function of a class template (13.7.2.2 [temp.mem.func]),

  • template specialization for which some template parameters are not specified (13.9 [temp.spec], _N4868_.13.7.6 [temp.class.spec]),

  • templated entity (13.1 [temp.pre]),

  • default argument for a parameter (for a function in a given scope), or

  • default template argument

in a program provided that...

[Drafting note: “with external linkage” is not needed for the inline entities because the other cases - entities attached to a named module and multiple definitions in the same translation unit - are ruled out later in that paragraph.]
Date: 2019-11-15.00:00:00

[Adopted as a DR at the November, 2019 meeting.]

The list of entities in 6.3 [basic.def.odr] paragraph 12 that can have multiple definitions across translation units does not, but should, include variable templates.

History
Date User Action Args
2020-12-15 00:00:00adminsetmessages: + msg6431
2019-10-10 00:00:00admincreate