<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 758</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="758"></A><H4>758.
  
Missing cases of declarations that are not definitions
</H4>
<B>Section: </B>6.2&#160; [<A href="https://wg21.link/basic.def">basic.def</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++11
 &#160;&#160;&#160;

 <B>Submitter: </B>Bjarne Stroustrup
 &#160;&#160;&#160;

 <B>Date: </B>22 January, 2009<BR><BR>


<P>[Voted into the WP at the March, 2011 meeting as part of paper N3262.]</P>

<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3086.html#UK23">N2800 comment
  UK&#160;23<BR></A>
<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3086.html#UK24">N2800 comment
  UK&#160;24<BR></A>



<P>The list of declarations that are not definitions given in
6.2 [<A href="https://wg21.link/basic.def#2">basic.def</A>] paragraph 2 does not mention several plausible
candidates: parameter declarations in non-defining function declarations,
non-static data members, and template parameters.  It might be argued
that none of these are <I>declaration</I>s (paragraph 1 does not use the
syntactic non-terminal <I>declaration</I> but does explicitly refer to
9.1 [<A href="https://wg21.link/dcl.pre">dcl.pre</A>], where that non-terminal is defined).
However, the list in paragraph 2 does mention static member declarations,
which also are not <I>declaration</I>s, so the intent is not clear.</P>

<P><B>Proposed resolution (November, 2010) [SUPERSEDED]:</B></P>

<P>Change 6.2 [<A href="https://wg21.link/basic.def#2">basic.def</A>] paragraph 2 as follows:</P>

<BLOCKQUOTE>

A declaration is a <I>definition</I> unless it declares a function
without specifying the function's body (9.6 [<A href="https://wg21.link/dcl.fct.def">dcl.fct.def</A>]), it
contains the <TT>extern</TT> specifier (9.2.2 [<A href="https://wg21.link/dcl.stc">dcl.stc</A>]) or
a <I>linkage-specification</I><SUP>25</SUP> (9.12 [<A href="https://wg21.link/dcl.link">dcl.link</A>])
and neither an <I>initializer</I> nor a <I>function-body</I>, it
declares a static data member in a class definition (<INS>11.4 [<A href="https://wg21.link/class.mem">class.mem</A>],</INS> 11.4.9 [<A href="https://wg21.link/class.static">class.static</A>]), it is a class name
declaration (11.3 [<A href="https://wg21.link/class.name">class.name</A>]), it is an
<I>opaque-enum-declaration</I> (9.8.1 [<A href="https://wg21.link/dcl.enum">dcl.enum</A>]), <INS>it
is a <I>template-parameter</I> (13.2 [<A href="https://wg21.link/temp.param">temp.param</A>]), it is a
<I>parameter-declaration</I> (9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]) in a
function declaration that is not a definition,</INS> or it is a
<TT>typedef</TT> declaration (9.2.4 [<A href="https://wg21.link/dcl.typedef">dcl.typedef</A>]), <INS>an
<I>alias-declaration (9.2.4 [<A href="https://wg21.link/dcl.typedef">dcl.typedef</A>]),</I></INS> a
<I>using-declaration</I> (9.10 [<A href="https://wg21.link/namespace.udecl">namespace.udecl</A>]), a
<I>static_assert-declaration</I> (9.1 [<A href="https://wg21.link/dcl.pre">dcl.pre</A>]), an
<I>attribute-declaration</I> (9.1 [<A href="https://wg21.link/dcl.pre">dcl.pre</A>]), an
<I>empty-declaration</I> (9.1 [<A href="https://wg21.link/dcl.pre">dcl.pre</A>]), or a
<I>using-directive</I> (9.9.4 [<A href="https://wg21.link/namespace.udir">namespace.udir</A>]).

</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
