Title
Matching declarations and definitions of variable templates
Status
cd6
Section
13.7 [temp.decls]
Submitter
Larisse Voufo

Created on 2013-08-05.00:00:00 last changed 27 months ago

Messages

Date: 2017-05-15.00:00:00

Proposed resolution (May, 2017):

This issue is resolved by the resolution of issue 1704.

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]

The relationship between declarations and definitions of variable templates is not clear. For example:

  template<typename T> auto var0 = T();  // #1a.
  template<typename T> extern T var0;    // #1b.

  template<typename T> T var1;           // #2a.
  template<typename T> extern auto var1; // #2b.
  template<typename T> extern T var1;    // #2c.
  template<typename T> T var1;           // #2d.

Questions:

  1. When is a variable template declaration a definition and when a non-defining declaration?

  2. What declarations are valid?

  3. Should auto declarations be allowed?

  4. To what extent, if any, do these involve type matching?

  5. How are types matched, especially in the presence of auto?

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: accepted -> drwp
2020-12-15 00:00:00adminsetstatus: drafting -> accepted
2018-02-27 00:00:00adminsetmessages: + msg5912
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-08-05 00:00:00admincreate