<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>

    C++ Standard Core Language
    
      Active Issues
     </TITLE>
</HEAD>
<BODY>
<TABLE ALIGN="RIGHT" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD ALIGN="RIGHT">
      Document number:
     </TD>
<TD>
        &#160;WG21 N4457</TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Date:
     </TD>
<TD>
      &#160;2015-04-13</TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Project:
     </TD>
<TD>
      &#160;Programming Language C++
     </TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Reference:
     </TD>
<TD>
      &#160;ISO/IEC IS 14882:2014
     </TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Reply to:
     </TD>
<TD>
      &#160;William M. Miller
     </TD>
</TR>
<TR>
<TD></TD>
<TD>
      &#160;Edison Design Group, Inc.
     </TD>
</TR>
<TR>
<TD></TD>
<TD>
      &#160;<A HREF="mailto://wmm@edg.com">wmm@edg.com</A></TD>
</TR>
</TABLE><BR CLEAR="ALL"><BR><CENTER>
<H2>

     C++ Standard Core Language
     
       Active Issues,
      

     Revision
     93</H2>
</CENTER><BR><P>
      This document contains the C++ core language issues on which the
      Committee (INCITS PL22.16 + WG21) has not yet acted, that is, issues
      with status
      "<A HREF="#Ready Status">Ready</A>,"
      "<A HREF="#Tentatively Ready Status">Tentatively Ready</A>,"
      "<A HREF="#Review Status">Review</A>,"
      "<A HREF="#Drafting Status">Drafting</A>," and
      "<A HREF="#Open Status">Open</A>."
     (See <A HREF="#Issue Status">Issue Status</A> below.)
     </P>
<P>
    This document is part of a group of related documents that
    together describe the issues that have been raised regarding the
    C++ Standard.  The other documents in the group are:
   </P>
<UL>
<LI><A HREF="cwg_closed.html">Closed Issues List</A>, which contains
      the issues which the Committee has decided are not defects
      in the International Standard, including a brief rationale
      explaining the reason for the decision.
     </LI>
<LI><A HREF="cwg_defects.html">Defect Reports List</A>, which contains
      the issues that have been categorized by the Committee as Defect
      Reports, as well as other issues accepted by the Committee, along
      with their proposed resolutions.
     </LI>
<LI><A HREF="cwg_toc.html">Table of Contents</A>, which contains a
     summary listing of all issues in numerical order.
    </LI>
<LI><A HREF="cwg_index.html">Index by Section</A>, which contains a
     summary listing of all issues arranged in the order of the
     sections of the Standard with which they deal most directly.
    </LI>
<LI><A HREF="cwg_status.html">Index by Status</A>, which contains a
     summary listing of all issues grouped by status.
    </LI>
</UL>
<P>
    Section references in this document reflect the section numbering
    of document
    <A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf">WG21 N4296</A>.
   </P>
<P>The purpose of these documents is to record the disposition of issues
that have come before the Core Language Working Group of the ANSI
(INCITS PL22.16) and ISO (WG21) C++ Standard Committee.</P>

<P>Some issues represent potential defects in the ISO/IEC IS
14882:2014 document and corrected defects in the earlier
2011, 2003, and 1998 documents; others refer to text in the
working draft for the next revision of the C++ language and
not to any Standard text.  Issues are not necessarily formal
ISO Defect Reports (DRs).  While some issues will eventually
be elevated to DR status, others will be disposed of in
other ways.</P>



<P>The most current public version of this document can be found at
<A HREF="http://www.open-std.org/jtc1/sc22/wg21">http://www.open-std.org/jtc1/sc22/wg21</A>. 
Requests for further information about these documents should include
the document number, reference ISO/IEC 14882:2014, and be
submitted to the InterNational Committee for Information Technology Standards
(INCITS),
1250&#160;Eye&#160;Street&#160;NW, Suite 200, Washington,&#160;DC&#160;20005,
USA.</P>

<P>Information regarding C++ standardization can be found at
<A HREF="http://isocpp.org/std">http://isocpp.org/std</A>.</P>

<BR>
<H3>Revision History</H3>

<UL>

<P><B>Revision 93, 2015-04-13:</B> Incorporated EWG decisions on issues
<A HREF="
     cwg_closed.html#92">92</A>,
<A HREF="
     cwg_closed.html#203">203</A>,
<A HREF="
     cwg_closed.html#622">622</A>,
<A HREF="
     cwg_closed.html#822">822</A>,
<A HREF="
     cwg_closed.html#1077">1077</A>,
<A HREF="
     cwg_closed.html#1259">1259</A>,
<A HREF="
     cwg_closed.html#1272">1272</A>,
<A HREF="
     cwg_closed.html#1564">1564</A>,
<A HREF="
     cwg_closed.html#1577">1577</A>,
<A HREF="
     cwg_active.html#1582">1582</A>,
<A HREF="
     cwg_closed.html#1586">1586</A>,
<A HREF="
     cwg_closed.html#1643">1643</A>,
<A HREF="
     cwg_closed.html#1754">1754</A>,
<A HREF="
     cwg_closed.html#1798">1798</A>,
<A HREF="
     cwg_active.html#1826">1826</A>, and
<A HREF="
     cwg_closed.html#1833">1833</A>.  Moved <A HREF="
     cwg_defects.html#1657">issue 1657</A>
to "accepted" status, reflecting adoption of paper N4266 at the Urbana
meeting. Moved <A HREF="
     cwg_defects.html#1683">issue 1683</A> to "DRWP" status,
reflecting approval of N4140 as the working paper at the November, 2014
meeting.  Incorporated resolutions from the drafting
review teleconference held 2015-04-06.
</P>

<P><B>Revision 92, 2014-11-24:</B> Changed all issues approved
by the Committee since the April, 2013 Committee Draft to "C++14"
status, to reflect the adoption of ISO/IEC 14882:2014. Moved issues
<A HREF="
     cwg_active.html#1299">1299</A>, <A HREF="
     cwg_active.html#1651">1651</A>,
<A HREF="
     cwg_active.html#1893">1893</A>, and <A HREF="
     cwg_active.html#1817">1817</A>
to "drafting" status, <A HREF="
     cwg_active.html#1584">1584</A> to
"open" status, and <A HREF="
     cwg_active.html#314">314</A>,
<A HREF="
     cwg_active.html#343">343</A>, <A HREF="
     cwg_active.html#1710">1710</A>,
<A HREF="
     cwg_active.html#1794">1794</A>, and <A HREF="
     cwg_active.html#1812">1812</A>
to "review" status in light of concerns that were raised with their
proposed resolutions.
Moved <A HREF="
     cwg_defects.html#1048">issue 1048</A> to "CD3" status to
reflect the fact that it had been addressed by paper N3638, adopted
at the April, 2013 (Bristol) meeting. 
Closed issues <A HREF="
     cwg_closed.html#550">550</A> and
<A HREF="
     cwg_closed.html#1855">1855</A> as duplicates. Reflected the actions
of the November, 2014 (Urbana) meeting. Added new issues
<A HREF="
     cwg_closed.html#1948">1948</A>,
<A HREF="
     cwg_active.html#1949">1949</A>,
<A HREF="
     cwg_closed.html#1950">1950</A>,
<A HREF="
     cwg_active.html#1951">1951</A>,
<A HREF="
     cwg_active.html#1952">1952</A>,
<A HREF="
     cwg_active.html#1953">1953</A>,
<A HREF="
     cwg_active.html#1954">1954</A>,
<A HREF="
     cwg_active.html#1955">1955</A>,
<A HREF="
     cwg_active.html#1956">1956</A>,
<A HREF="
     cwg_closed.html#1957">1957</A>,
<A HREF="
     cwg_active.html#1958">1958</A>,
<A HREF="
     cwg_active.html#1959">1959</A>,
<A HREF="
     cwg_closed.html#1960">1960</A>,
<A HREF="
     cwg_active.html#1961">1961</A>,
<A HREF="
     cwg_active.html#1962">1962</A>,
<A HREF="
     cwg_active.html#1963">1963</A>,
<A HREF="
     cwg_closed.html#1964">1964</A>,
<A HREF="
     cwg_active.html#1965">1965</A>,
<A HREF="
     cwg_active.html#1966">1966</A>,
<A HREF="
     cwg_active.html#1967">1967</A>,
<A HREF="
     cwg_closed.html#1968">1968</A>,
<A HREF="
     cwg_active.html#1969">1969</A>,
<A HREF="
     cwg_closed.html#1970">1970</A>,
<A HREF="
     cwg_active.html#1971">1971</A>,
<A HREF="
     cwg_active.html#1972">1972</A>,
<A HREF="
     cwg_active.html#1973">1973</A>,
<A HREF="
     cwg_active.html#1974">1974</A>,
<A HREF="
     cwg_active.html#1975">1975</A>,
<A HREF="
     cwg_closed.html#1976">1976</A>,
<A HREF="
     cwg_active.html#1977">1977</A>,
<A HREF="
     cwg_active.html#1978">1978</A>,
<A HREF="
     cwg_active.html#1979">1979</A>,
<A HREF="
     cwg_active.html#1980">1980</A>,
<A HREF="
     cwg_active.html#1981">1981</A>,
<A HREF="
     cwg_closed.html#1982">1982</A>,
<A HREF="
     cwg_active.html#1983">1983</A>,
<A HREF="
     cwg_closed.html#1984">1984</A>,
<A HREF="
     cwg_closed.html#1985">1985</A>,
<A HREF="
     cwg_active.html#1986">1986</A>,
<A HREF="
     cwg_closed.html#1987">1987</A>,
<A HREF="
     cwg_active.html#1988">1988</A>,
<A HREF="
     cwg_active.html#1989">1989</A>,
<A HREF="
     cwg_active.html#1990">1990</A>,
<A HREF="
     cwg_active.html#1991">1991</A>,
<A HREF="
     cwg_active.html#1992">1992</A>,
<A HREF="
     cwg_active.html#1993">1993</A>,
<A HREF="
     cwg_closed.html#1994">1994</A>,
<A HREF="
     cwg_active.html#1995">1995</A>,
<A HREF="
     cwg_active.html#1996">1996</A>,
<A HREF="
     cwg_active.html#1997">1997</A>,
<A HREF="
     cwg_closed.html#1998">1998</A>,
<A HREF="
     cwg_active.html#1999">1999</A>,
<A HREF="
     cwg_active.html#2000">2000</A>,
<A HREF="
     cwg_active.html#2001">2001</A>,
<A HREF="
     cwg_active.html#2002">2002</A>,
<A HREF="
     cwg_active.html#2003">2003</A>,
<A HREF="
     cwg_active.html#2004">2004</A>,
<A HREF="
     cwg_closed.html#2005">2005</A>,
<A HREF="
     cwg_active.html#2006">2006</A>,
<A HREF="
     cwg_active.html#2007">2007</A>,
<A HREF="
     cwg_active.html#2008">2008</A>,
<A HREF="
     cwg_active.html#2009">2009</A>,
<A HREF="
     cwg_active.html#2010">2010</A>,
<A HREF="
     cwg_active.html#2011">2011</A>,
<A HREF="
     cwg_active.html#2012">2012</A>,
<A HREF="
     cwg_active.html#2013">2013</A>,
<A HREF="
     cwg_closed.html#2014">2014</A>,
<A HREF="
     cwg_active.html#2015">2015</A>,
<A HREF="
     cwg_active.html#2016">2016</A>,
<A HREF="
     cwg_active.html#2017">2017</A>,
<A HREF="
     cwg_active.html#2018">2018</A>,
<A HREF="
     cwg_active.html#2019">2019</A>,
<A HREF="
     cwg_active.html#2020">2020</A>,
<A HREF="
     cwg_closed.html#2021">2021</A>,
<A HREF="
     cwg_active.html#2022">2022</A>,
<A HREF="
     cwg_active.html#2023">2023</A>,
<A HREF="
     cwg_active.html#2024">2024</A>,
<A HREF="
     cwg_active.html#2025">2025</A>,
<A HREF="
     cwg_active.html#2026">2026</A>,
<A HREF="
     cwg_active.html#2027">2027</A>,
<A HREF="
     cwg_active.html#2028">2028</A>,
<A HREF="
     cwg_closed.html#2029">2029</A>,
<A HREF="
     cwg_closed.html#2030">2030</A>,
<A HREF="
     cwg_active.html#2031">2031</A>,
<A HREF="
     cwg_active.html#2032">2032</A>,
<A HREF="
     cwg_active.html#2033">2033</A>,
<A HREF="
     cwg_active.html#2034">2034</A>, and
<A HREF="
     cwg_active.html#2035">2035</A>.
</P>

<P><B>Revision 91, 2014-10-13:</B> Incorporated deliberations of drafting
review teleconferences held 2014-07-14 and 2014-10-06.  Added new issue
<A HREF="
     cwg_closed.html#1947">1947</A>.
</P>

<P><B>Revision 90, 2014-07-07:</B> <A HREF="
     cwg_active.html#1715">Issue 1715</A>
was returned to "drafting" status in light of an alternative suggestion
for its resolution.  <A HREF="
     cwg_closed.html#1927">Issue 1927</A> was closed
as a duplicate of <A HREF="
     cwg_closed.html#1695">issue 1695</A>. Reflected the
deliberations of CWG at the 2014-06 (Rapperswil) meeting. Added new issues
<A HREF="
     cwg_active.html#1932">1932</A>,
<A HREF="
     cwg_closed.html#1933">1933</A>,
<A HREF="
     cwg_closed.html#1934">1934</A>,
<A HREF="
     cwg_active.html#1935">1935</A>,
<A HREF="
     cwg_active.html#1936">1936</A>,
<A HREF="
     cwg_active.html#1937">1937</A>,
<A HREF="
     cwg_active.html#1938">1938</A>,
<A HREF="
     cwg_active.html#1939">1939</A>,
<A HREF="
     cwg_defects.html#1940">1940</A>,
<A HREF="
     cwg_active.html#1941">1941</A>,
<A HREF="
     cwg_active.html#1942">1942</A>,
<A HREF="
     cwg_active.html#1943">1943</A>,
<A HREF="
     cwg_active.html#1944">1944</A>,
<A HREF="
     cwg_active.html#1945">1945</A>, and
<A HREF="
     cwg_active.html#1946">1946</A>.
</P>

<P><B>Revision 89, 2014-05-27:</B> Issues <A HREF="
     cwg_defects.html#1351">1351</A>
<A HREF="
     cwg_defects.html#1356">1356</A> <A HREF="
     cwg_defects.html#1465">1465</A>,
<A HREF="
     cwg_active.html#1590">1590</A>, <A HREF="
     cwg_defects.html#1639">1639</A>
<A HREF="
     cwg_defects.html#1708">1708</A>, and <A HREF="
     cwg_defects.html#1810">1810</A>
were returned to "review" status for further discussion.  Restored
<A HREF="
     cwg_defects.html#1397">issue 1397</A> to "ready"; it had incorrectly
been moved back to "drafting" because of a misunderstood comment.
Added new issues
<A HREF="
     cwg_defects.html#1866">1866</A>,
<A HREF="
     cwg_closed.html#1867">1867</A>,
<A HREF="
     cwg_active.html#1868">1868</A>,
<A HREF="
     cwg_closed.html#1869">1869</A>,
<A HREF="
     cwg_defects.html#1870">1870</A>,
<A HREF="
     cwg_closed.html#1871">1871</A>,
<A HREF="
     cwg_active.html#1872">1872</A>,
<A HREF="
     cwg_active.html#1873">1873</A>,
<A HREF="
     cwg_defects.html#1874">1874</A>,
<A HREF="
     cwg_active.html#1875">1875</A>,
<A HREF="
     cwg_closed.html#1876">1876</A>,
<A HREF="
     cwg_defects.html#1877">1877</A>,
<A HREF="
     cwg_defects.html#1878">1878</A>,
<A HREF="
     cwg_closed.html#1879">1879</A>,
<A HREF="
     cwg_active.html#1880">1880</A>,
<A HREF="
     cwg_defects.html#1881">1881</A>,
<A HREF="
     cwg_defects.html#1882">1882</A>,
<A HREF="
     cwg_active.html#1883">1883</A>,
<A HREF="
     cwg_active.html#1884">1884</A>,
<A HREF="
     cwg_defects.html#1885">1885</A>,
<A HREF="
     cwg_active.html#1886">1886</A>,
<A HREF="
     cwg_defects.html#1887">1887</A>,
<A HREF="
     cwg_active.html#1888">1888</A>,
<A HREF="
     cwg_active.html#1889">1889</A>,
<A HREF="
     cwg_active.html#1890">1890</A>,
<A HREF="
     cwg_defects.html#1891">1891</A>,
<A HREF="
     cwg_defects.html#1892">1892</A>,
<A HREF="
     cwg_active.html#1893">1893</A>,
<A HREF="
     cwg_active.html#1894">1894</A>,
<A HREF="
     cwg_active.html#1895">1895</A>,
<A HREF="
     cwg_active.html#1896">1896</A>,
<A HREF="
     cwg_active.html#1897">1897</A>,
<A HREF="
     cwg_active.html#1898">1898</A>,
<A HREF="
     cwg_active.html#1899">1899</A>,
<A HREF="
     cwg_active.html#1900">1900</A>,
<A HREF="
     cwg_active.html#1901">1901</A>,
<A HREF="
     cwg_defects.html#1902">1902</A>,
<A HREF="
     cwg_active.html#1903">1903</A>,
<A HREF="
     cwg_closed.html#1904">1904</A>,
<A HREF="">1905</A>,
<A HREF="
     cwg_active.html#1906">1906</A>,
<A HREF="
     cwg_active.html#1907">1907</A>,
<A HREF="
     cwg_active.html#1908">1908</A>,
<A HREF="
     cwg_defects.html#1909">1909</A>,
<A HREF="
     cwg_active.html#1910">1910</A>,
<A HREF="
     cwg_defects.html#1911">1911</A>,
<A HREF="
     cwg_closed.html#1912">1912</A>,
<A HREF="
     cwg_active.html#1913">1913</A>,
<A HREF="
     cwg_closed.html#1914">1914</A>,
<A HREF="
     cwg_closed.html#1915">1915</A>,
<A HREF="
     cwg_active.html#1916">1916</A>,
<A HREF="
     cwg_active.html#1917">1917</A>,
<A HREF="
     cwg_active.html#1918">1918</A>,
<A HREF="
     cwg_active.html#1919">1919</A>,
<A HREF="
     cwg_active.html#1920">1920</A>,
<A HREF="
     cwg_closed.html#1921">1921</A>,
<A HREF="
     cwg_active.html#1922">1922</A>,
<A HREF="
     cwg_closed.html#1923">1923</A>,
<A HREF="
     cwg_active.html#1924">1924</A>,
<A HREF="
     cwg_active.html#1925">1925</A>,
<A HREF="
     cwg_active.html#1926">1926</A>,
<A HREF="
     cwg_closed.html#1927">1927</A>,
<A HREF="
     cwg_active.html#1928">1928</A>,
<A HREF="
     cwg_active.html#1929">1929</A>,
<A HREF="
     cwg_active.html#1930">1930</A>, and
<A HREF="
     cwg_closed.html#1931">1931</A>.
</P>

<LI><B>Revision 88, 2014-03-03:</B> Changed the "FDIS" status to "C++11",
reflecting having voted out a new DIS.  Changed issues in "WP" and
"DRWP" status to "CD3", reflecting the fact that their resolutions were
contained in the Committee Draft approved for balloting at the April, 2013
meeting.  Changed the status of <A HREF="
     cwg_defects.html#344">issue 344</A> to
"CD3" when it was noticed that it was resolved by the resolution of
<A HREF="
     cwg_defects.html#1435">issue 1435</A>. Changed the status of
<A HREF="
     cwg_defects.html#1491">issue 1491</A> to "CD3" when it was noticed that it
was resolved by the resolution of <A HREF="
     cwg_defects.html#1402">issue 1402</A>.
Reflected the deliberations of the
February, 2014 (Issaquah) meeting.
Added new issues
<A HREF="
     cwg_active.html#1837">1837</A>,
<A HREF="
     cwg_defects.html#1838">1838</A>,
<A HREF="
     cwg_active.html#1839">1839</A>,
<A HREF="
     cwg_active.html#1840">1840</A>,
<A HREF="
     cwg_active.html#1841">1841</A>,
<A HREF="
     cwg_active.html#1842">1842</A>,
<A HREF="
     cwg_defects.html#1843">1843</A>,
<A HREF="
     cwg_active.html#1844">1844</A>,
<A HREF="
     cwg_active.html#1845">1845</A>,
<A HREF="
     cwg_defects.html#1846">1846</A>,
<A HREF="
     cwg_active.html#1847">1847</A>,
<A HREF="
     cwg_defects.html#1848">1848</A>,
<A HREF="
     cwg_active.html#1849">1849</A>,
<A HREF="
     cwg_defects.html#1850">1850</A>,
<A HREF="
     cwg_defects.html#1851">1851</A>,
<A HREF="
     cwg_defects.html#1852">1852</A>,
<A HREF="
     cwg_active.html#1853">1853</A>,
<A HREF="
     cwg_active.html#1854">1854</A>,
<A HREF="
     cwg_closed.html#1855">1855</A>,
<A HREF="
     cwg_active.html#1856">1856</A>,
<A HREF="
     cwg_active.html#1857">1857</A>,
<A HREF="
     cwg_defects.html#1858">1858</A>,
<A HREF="
     cwg_active.html#1859">1859</A>,
<A HREF="
     cwg_active.html#1860">1860</A>,
<A HREF="
     cwg_active.html#1861">1861</A>,
<A HREF="
     cwg_active.html#1862">1862</A>,
<A HREF="
     cwg_active.html#1863">1863</A>,
<A HREF="
     cwg_closed.html#1864">1864</A>, and
<A HREF="
     cwg_defects.html#1865">1865</A>.
</LI>

<LI><B>Revision 87, 2014-01-20:</B> Incorporated the results of the
drafting review teleconferences held 2013-11-25 and 2014-01-13.
Changed status of <A HREF="
     cwg_closed.html#1469">issue 1469</A> to
"extension", reflecting the consensus of the 2012-08-13 drafting
review teleconference.  Moved <A HREF="
     cwg_defects.html#1480">issue 1480</A>
to "WP" status because it was rendered moot by the adoption of N3652
at the April, 2013 meeting.
Added new issues
<A HREF="
     cwg_defects.html#1796">1796</A>,
<A HREF="
     cwg_defects.html#1797">1797</A>,
<A HREF="
     cwg_closed.html#1798">1798</A>,
<A HREF="
     cwg_defects.html#1799">1799</A>,
<A HREF="
     cwg_defects.html#1800">1800</A>,
<A HREF="
     cwg_active.html#1801">1801</A>,
<A HREF="
     cwg_defects.html#1802">1802</A>,
<A HREF="
     cwg_active.html#1803">1803</A>,
<A HREF="
     cwg_defects.html#1804">1804</A>,
<A HREF="
     cwg_defects.html#1805">1805</A>,
<A HREF="
     cwg_defects.html#1806">1806</A>,
<A HREF="
     cwg_defects.html#1807">1807</A>,
<A HREF="
     cwg_active.html#1808">1808</A>,
<A HREF="
     cwg_defects.html#1809">1809</A>,
<A HREF="
     cwg_defects.html#1810">1810</A>,
<A HREF="
     cwg_defects.html#1811">1811</A>,
<A HREF="
     cwg_active.html#1812">1812</A>,
<A HREF="
     cwg_defects.html#1813">1813</A>,
<A HREF="
     cwg_defects.html#1814">1814</A>,
<A HREF="
     cwg_defects.html#1815">1815</A>,
<A HREF="
     cwg_defects.html#1816">1816</A>,
<A HREF="
     cwg_active.html#1817">1817</A>,
<A HREF="
     cwg_active.html#1818">1818</A>,
<A HREF="
     cwg_defects.html#1819">1819</A>,
<A HREF="
     cwg_active.html#1820">1820</A>,
<A HREF="
     cwg_active.html#1821">1821</A>,
<A HREF="
     cwg_active.html#1822">1822</A>,
<A HREF="
     cwg_defects.html#1823">1823</A>,
<A HREF="
     cwg_defects.html#1824">1824</A>,
<A HREF="
     cwg_active.html#1825">1825</A>,
<A HREF="
     cwg_active.html#1826">1826</A>,
<A HREF="
     cwg_active.html#1827">1827</A>,
<A HREF="
     cwg_active.html#1828">1828</A>,
<A HREF="
     cwg_active.html#1829">1829</A>,
<A HREF="
     cwg_defects.html#1830">1830</A>,
<A HREF="
     cwg_closed.html#1831">1831</A>,
<A HREF="
     cwg_defects.html#1832">1832</A>,
<A HREF="
     cwg_closed.html#1833">1833</A>,
<A HREF="
     cwg_defects.html#1834">1834</A>,
<A HREF="
     cwg_active.html#1835">1835</A>, and
<A HREF="
     cwg_active.html#1836">1836</A>.
</LI>

<LI><B>Revision 86, 2013-10-14:</B> Reflected the deliberations of the
September, 2013 (Chicago) meeting.  Added new issues
<A HREF="
     cwg_active.html#1743">1743</A>,
<A HREF="
     cwg_defects.html#1744">1744</A>,
<A HREF="
     cwg_closed.html#1745">1745</A>,
<A HREF="
     cwg_defects.html#1746">1746</A>,
<A HREF="
     cwg_defects.html#1747">1747</A>,
<A HREF="
     cwg_defects.html#1748">1748</A>,
<A HREF="
     cwg_closed.html#1749">1749</A>,
<A HREF="
     cwg_defects.html#1750">1750</A>,
<A HREF="
     cwg_defects.html#1751">1751</A>,
<A HREF="
     cwg_defects.html#1752">1752</A>,
<A HREF="
     cwg_defects.html#1753">1753</A>,
<A HREF="
     cwg_closed.html#1754">1754</A>,
<A HREF="
     cwg_active.html#1755">1755</A>,
<A HREF="
     cwg_defects.html#1756">1756</A>,
<A HREF="
     cwg_defects.html#1757">1757</A>,
<A HREF="
     cwg_defects.html#1758">1758</A>,
<A HREF="
     cwg_defects.html#1759">1759</A>,
<A HREF="
     cwg_defects.html#1760">1760</A>,
<A HREF="
     cwg_closed.html#1761">1761</A>,
<A HREF="
     cwg_defects.html#1762">1762</A>,
<A HREF="
     cwg_active.html#1763">1763</A>,
<A HREF="
     cwg_defects.html#1764">1764</A>,
<A HREF="
     cwg_defects.html#1765">1765</A>,
<A HREF="
     cwg_defects.html#1766">1766</A>,
<A HREF="
     cwg_defects.html#1767">1767</A>,
<A HREF="
     cwg_closed.html#1768">1768</A>,
<A HREF="
     cwg_defects.html#1769">1769</A>,
<A HREF="
     cwg_defects.html#1770">1770</A>,
<A HREF="
     cwg_active.html#1771">1771</A>,
<A HREF="
     cwg_defects.html#1772">1772</A>,
<A HREF="
     cwg_defects.html#1773">1773</A>,
<A HREF="
     cwg_defects.html#1774">1774</A>,
<A HREF="
     cwg_defects.html#1775">1775</A>,
<A HREF="
     cwg_active.html#1776">1776</A>,
<A HREF="
     cwg_defects.html#1777">1777</A>,
<A HREF="
     cwg_defects.html#1778">1778</A>,
<A HREF="
     cwg_defects.html#1779">1779</A>,
<A HREF="
     cwg_defects.html#1780">1780</A>,
<A HREF="
     cwg_active.html#1781">1781</A>,
<A HREF="
     cwg_defects.html#1782">1782</A>,
<A HREF="
     cwg_closed.html#1783">1783</A>,
<A HREF="
     cwg_active.html#1784">1784</A>,
<A HREF="
     cwg_active.html#1785">1785</A>,
<A HREF="
     cwg_defects.html#1786">1786</A>,
<A HREF="
     cwg_defects.html#1787">1787</A>,
<A HREF="
     cwg_defects.html#1788">1788</A>,
<A HREF="
     cwg_active.html#1789">1789</A>,
<A HREF="
     cwg_closed.html#1790">1790</A>,
<A HREF="
     cwg_defects.html#1791">1791</A>,
<A HREF="
     cwg_closed.html#1792">1792</A>,
<A HREF="
     cwg_defects.html#1793">1793</A>,
<A HREF="
     cwg_active.html#1794">1794</A>, and
<A HREF="
     cwg_defects.html#1795">1795</A>.
</LI>

<LI><B>Revision 85, 2013-09-03:</B> Incorporated the results of the
drafting review teleconferences held 2013-06-24 and 2013-08-26. Changed
the status of <A HREF="
     cwg_defects.html#583">issue 583</A> to "DR" because it
was (silently) addressed by N3624. Changed the status of
<A HREF="
     cwg_defects.html#1531">issue 1531</A> to "DR" because it had been
inadvertently overlooked in recording the motions of the April, 2013
meeting. Changed the status of <A HREF="
     cwg_defects.html#1597">issue 1597</A> to
"accepted" because it is moot after the adoption of N3652. Returned
<A HREF="
     cwg_active.html#1609">issue 1609</A> to "open" status in light of
additional discussion.  Added new information to the description of
<A HREF="
     cwg_active.html#1335">issue 1335</A>. Added new issues
<A HREF="
     cwg_defects.html#1657">1657</A>,
<A HREF="
     cwg_defects.html#1658">1658</A>,
<A HREF="
     cwg_active.html#1659">1659</A>,
<A HREF="
     cwg_defects.html#1660">1660</A>,
<A HREF="
     cwg_active.html#1661">1661</A>,
<A HREF="
     cwg_defects.html#1662">1662</A>,
<A HREF="
     cwg_closed.html#1663">1663</A>,
<A HREF="
     cwg_defects.html#1664">1664</A>,
<A HREF="
     cwg_active.html#1665">1665</A>,
<A HREF="
     cwg_defects.html#1666">1666</A>,
<A HREF="
     cwg_closed.html#1667">1667</A>,
<A HREF="
     cwg_active.html#1668">1668</A>,
<A HREF="
     cwg_defects.html#1669">1669</A>,
<A HREF="
     cwg_active.html#1670">1670</A>,
<A HREF="
     cwg_closed.html#1671">1671</A>,
<A HREF="
     cwg_defects.html#1672">1672</A>,
<A HREF="
     cwg_defects.html#1673">1673</A>,
<A HREF="
     cwg_defects.html#1674">1674</A>,
<A HREF="
     cwg_closed.html#1675">1675</A>,
<A HREF="
     cwg_active.html#1676">1676</A>,
<A HREF="
     cwg_active.html#1677">1677</A>,
<A HREF="
     cwg_closed.html#1678">1678</A>,
<A HREF="
     cwg_closed.html#1679">1679</A>,
<A HREF="
     cwg_active.html#1680">1680</A>,
<A HREF="
     cwg_defects.html#1681">1681</A>,
<A HREF="
     cwg_active.html#1682">1682</A>,
<A HREF="
     cwg_defects.html#1683">1683</A>,
<A HREF="
     cwg_defects.html#1684">1684</A>,
<A HREF="
     cwg_closed.html#1685">1685</A>,
<A HREF="
     cwg_defects.html#1686">1686</A>,
<A HREF="
     cwg_defects.html#1687">1687</A>,
<A HREF="
     cwg_closed.html#1688">1688</A>,
<A HREF="
     cwg_defects.html#1689">1689</A>,
<A HREF="
     cwg_defects.html#1690">1690</A>,
<A HREF="
     cwg_defects.html#1691">1691</A>,
<A HREF="
     cwg_defects.html#1692">1692</A>,
<A HREF="
     cwg_defects.html#1693">1693</A>,
<A HREF="
     cwg_defects.html#1694">1694</A>,
<A HREF="
     cwg_closed.html#1695">1695</A>,
<A HREF="
     cwg_defects.html#1696">1696</A>,
<A HREF="
     cwg_active.html#1697">1697</A>,
<A HREF="
     cwg_active.html#1698">1698</A>,
<A HREF="
     cwg_active.html#1699">1699</A>,
<A HREF="
     cwg_closed.html#1700">1700</A>,
<A HREF="
     cwg_active.html#1701">1701</A>,
<A HREF="
     cwg_active.html#1702">1702</A>,
<A HREF="
     cwg_closed.html#1703">1703</A>,
<A HREF="
     cwg_active.html#1704">1704</A>,
<A HREF="
     cwg_defects.html#1705">1705</A>,
<A HREF="
     cwg_active.html#1706">1706</A>,
<A HREF="
     cwg_defects.html#1707">1707</A>,
<A HREF="
     cwg_defects.html#1708">1708</A>,
<A HREF="
     cwg_active.html#1709">1709</A>,
<A HREF="
     cwg_active.html#1710">1710</A>,
<A HREF="
     cwg_active.html#1711">1711</A>,
<A HREF="
     cwg_defects.html#1712">1712</A>,
<A HREF="
     cwg_active.html#1713">1713</A>,
<A HREF="
     cwg_closed.html#1714">1714</A>,
<A HREF="
     cwg_active.html#1715">1715</A>,
<A HREF="
     cwg_defects.html#1716">1716</A>,
<A HREF="
     cwg_defects.html#1717">1717</A>,
<A HREF="
     cwg_active.html#1718">1718</A>,
<A HREF="
     cwg_defects.html#1719">1719</A>,
<A HREF="
     cwg_closed.html#1720">1720</A>,
<A HREF="
     cwg_active.html#1721">1721</A>,
<A HREF="
     cwg_active.html#1722">1722</A>,
<A HREF="
     cwg_active.html#1723">1723</A>,
<A HREF="
     cwg_active.html#1724">1724</A>,
<A HREF="
     cwg_closed.html#1725">1725</A>,
<A HREF="
     cwg_active.html#1726">1726</A>,
<A HREF="
     cwg_closed.html#1727">1727</A>,
<A HREF="
     cwg_active.html#1728">1728</A>,
<A HREF="
     cwg_active.html#1729">1729</A>,
<A HREF="
     cwg_active.html#1730">1730</A>,
<A HREF="
     cwg_closed.html#1731">1731</A>,
<A HREF="
     cwg_defects.html#1732">1732</A>,
<A HREF="
     cwg_active.html#1733">1733</A>,
<A HREF="
     cwg_active.html#1734">1734</A>,
<A HREF="
     cwg_active.html#1735">1735</A>,
<A HREF="
     cwg_active.html#1736">1736</A>,
<A HREF="
     cwg_defects.html#1737">1737</A>,
<A HREF="
     cwg_defects.html#1738">1738</A>,
<A HREF="
     cwg_defects.html#1739">1739</A>,
<A HREF="
     cwg_defects.html#1740">1740</A>,
<A HREF="
     cwg_defects.html#1741">1741</A>, and
<A HREF="
     cwg_active.html#1742">1742</A>.
</LI>

<LI><B>Revision 84, 2013-05-03:</B> Incorporated the results of the drafting
review teleconference held 2013-03-25 and the deliberations of the April, 2013
(Bristol) meeting.  Changed
<A HREF="
     cwg_closed.html#1568">issue 1568</A> to "dup" status.  Changed the
status of <A HREF="
     cwg_defects.html#1492">issue 1492</A> to "drafting" status,
although it was approved as a DR at the meeting, because its resolution
is to be given by another resolution that was not moved.  Similarly,
issues <A HREF="
     cwg_defects.html#1356">1356</A> and <A HREF="
     cwg_defects.html#1465">1465</A>
were incorrectly moved as defect reports and have been returned to "review"
status awaiting the adoption of <A HREF="
     cwg_defects.html#1351">issue 1351</A>.
Also, <A HREF="
     cwg_defects.html#1531">issue 1531</A> was moved as a DR but was
lacking the proposed resolution in the document in the pre-meeting mailing,
so it has been returned to "ready" status to be moved at the next meeting.
Changed the resolutions of issues <A HREF="
     cwg_defects.html#1374">1374</A> and
<A HREF="
     cwg_defects.html#1543">1543</A> to correct
clerical errors transcribing the original proposed resolutions.  Began the
practice of marking proposed resolutions as "[SUPERSEDED]" when a newer
one is added.
Added new issues
<A HREF="
     cwg_active.html#1642">1642</A>,
<A HREF="
     cwg_closed.html#1643">1643</A>,
<A HREF="
     cwg_active.html#1644">1644</A>,
<A HREF="
     cwg_active.html#1645">1645</A>,
<A HREF="
     cwg_active.html#1646">1646</A>,
<A HREF="
     cwg_active.html#1647">1647</A>,
<A HREF="
     cwg_defects.html#1648">1648</A>,
<A HREF="
     cwg_defects.html#1649">1649</A>,
<A HREF="
     cwg_closed.html#1650">1650</A>,
<A HREF="
     cwg_active.html#1651">1651</A>,
<A HREF="
     cwg_active.html#1652">1652</A>,
<A HREF="
     cwg_active.html#1653">1653</A>,
<A HREF="
     cwg_closed.html#1654">1654</A>,
<A HREF="
     cwg_active.html#1655">1655</A>, and
<A HREF="
     cwg_active.html#1656">1656</A>.
</LI>

<LI><B>Revision 83, 2013-03-18:</B> Incorporated the results of the
drafting review teleconference held 2013-02-04, including moving
<A HREF="
     cwg_closed.html#1566">issue 1566</A> to "NAD" status.  Moved issues
<A HREF="
     cwg_defects.html#1417">1417</A> and <A HREF="
     cwg_defects.html#1460">1460</A> back to
"review" status in light of new questions.  Updated the &#8220;more
information&#8221; link to refer to <TT>isocpp.org</TT>.  Added new issues
<A HREF="
     cwg_closed.html#1606">1606</A>,
<A HREF="
     cwg_defects.html#1607">1607</A>,
<A HREF="
     cwg_defects.html#1608">1608</A>,
<A HREF="
     cwg_active.html#1609">1609</A>,
<A HREF="
     cwg_active.html#1610">1610</A>,
<A HREF="
     cwg_defects.html#1611">1611</A>,
<A HREF="
     cwg_defects.html#1612">1612</A>,
<A HREF="
     cwg_defects.html#1613">1613</A>,
<A HREF="
     cwg_defects.html#1614">1614</A>,
<A HREF="
     cwg_defects.html#1615">1615</A>,
<A HREF="
     cwg_active.html#1616">1616</A>,
<A HREF="
     cwg_active.html#1617">1617</A>,
<A HREF="
     cwg_defects.html#1618">1618</A>,
<A HREF="
     cwg_active.html#1619">1619</A>,
<A HREF="
     cwg_active.html#1620">1620</A>,
<A HREF="
     cwg_active.html#1621">1621</A>,
<A HREF="
     cwg_active.html#1622">1622</A>,
<A HREF="
     cwg_active.html#1623">1623</A>,
<A HREF="
     cwg_closed.html#1624">1624</A>,
<A HREF="
     cwg_active.html#1625">1625</A>,
<A HREF="
     cwg_active.html#1626">1626</A>,
<A HREF="
     cwg_closed.html#1627">1627</A>,
<A HREF="
     cwg_active.html#1628">1628</A>,
<A HREF="
     cwg_defects.html#1629">1629</A>,
<A HREF="
     cwg_defects.html#1630">1630</A>,
<A HREF="
     cwg_defects.html#1631">1631</A>,
<A HREF="
     cwg_active.html#1632">1632</A>,
<A HREF="
     cwg_defects.html#1633">1633</A>,
<A HREF="
     cwg_active.html#1634">1634</A>,
<A HREF="
     cwg_active.html#1635">1635</A>,
<A HREF="
     cwg_active.html#1636">1636</A>,
<A HREF="
     cwg_closed.html#1637">1637</A>,
<A HREF="
     cwg_active.html#1638">1638</A>,
<A HREF="
     cwg_defects.html#1639">1639</A>,
<A HREF="
     cwg_active.html#1640">1640</A>, and
<A HREF="
     cwg_closed.html#1641">1641</A>.
</LI>

<LI><B>Revision 82, 2013-01-14:</B> Incorporated the results of the
drafting review teleconference held 2012-12-10.  Moved issues
<A HREF="
     cwg_defects.html#903">903</A>, <A HREF="
     cwg_defects.html#1213">1213</A>,
<A HREF="
     cwg_defects.html#1358">1358</A>,
<A HREF="
     cwg_defects.html#1492">1492</A>, <A HREF="
     cwg_defects.html#1508">1508</A>,
and <A HREF="
     cwg_defects.html#1552">1552</A> to "review" status to allow further
consideration in light of subsequent discussion.  Added new issues
<A HREF="
     cwg_defects.html#1569">1569</A>,
<A HREF="
     cwg_defects.html#1570">1570</A>,
<A HREF="
     cwg_defects.html#1571">1571</A>,
<A HREF="
     cwg_defects.html#1572">1572</A>,
<A HREF="
     cwg_defects.html#1573">1573</A>,
<A HREF="
     cwg_closed.html#1574">1574</A>,
<A HREF="
     cwg_defects.html#1575">1575</A>,
<A HREF="
     cwg_defects.html#1576">1576</A>,
<A HREF="
     cwg_closed.html#1577">1577</A>,
<A HREF="
     cwg_closed.html#1578">1578</A>,
<A HREF="
     cwg_defects.html#1579">1579</A>,
<A HREF="
     cwg_active.html#1580">1580</A>,
<A HREF="
     cwg_active.html#1581">1581</A>,
<A HREF="
     cwg_active.html#1582">1582</A>,
<A HREF="
     cwg_defects.html#1583">1583</A>,
<A HREF="
     cwg_active.html#1584">1584</A>,
<A HREF="
     cwg_closed.html#1585">1585</A>,
<A HREF="
     cwg_closed.html#1586">1586</A>,
<A HREF="
     cwg_defects.html#1587">1587</A>,
<A HREF="
     cwg_defects.html#1588">1588</A>,
<A HREF="
     cwg_defects.html#1589">1589</A>,
<A HREF="
     cwg_active.html#1590">1590</A>,
<A HREF="
     cwg_defects.html#1591">1591</A>,
<A HREF="
     cwg_defects.html#1592">1592</A>,
<A HREF="
     cwg_defects.html#1593">1593</A>,
<A HREF="
     cwg_active.html#1594">1594</A>,
<A HREF="
     cwg_defects.html#1595">1595</A>,
<A HREF="
     cwg_defects.html#1596">1596</A>,
<A HREF="
     cwg_defects.html#1597">1597</A>,
<A HREF="
     cwg_defects.html#1598">1598</A>,
<A HREF="
     cwg_active.html#1599">1599</A>,
<A HREF="
     cwg_defects.html#1600">1600</A>,
<A HREF="
     cwg_defects.html#1601">1601</A>,
<A HREF="
     cwg_active.html#1602">1602</A>,
<A HREF="
     cwg_defects.html#1603">1603</A>,
<A HREF="
     cwg_defects.html#1604">1604</A>, and
<A HREF="
     cwg_defects.html#1605">1605</A>.
</LI>

<LI><B>Revision 81, 2012-11-03:</B> Reflected the deliberations of the
October, 2012 (Portland) meeting.
Added new issues
<A HREF="
     cwg_defects.html#1560">1560</A>,
<A HREF="
     cwg_closed.html#1561">1561</A>,
<A HREF="
     cwg_defects.html#1562">1562</A>,
<A HREF="
     cwg_defects.html#1563">1563</A>,
<A HREF="
     cwg_closed.html#1564">1564</A>,
<A HREF="
     cwg_active.html#1565">1565</A>,
<A HREF="
     cwg_closed.html#1566">1566</A>,
<A HREF="
     cwg_defects.html#1567">1567</A>, and
<A HREF="
     cwg_closed.html#1568">1568</A>.
</LI>

<LI><B>Revision 80, 2012-09-24:</B> Added remaining descriptions omitted from
issues added in revision 77.  Corrected status of issues
<A HREF="
     cwg_defects.html#915">915</A>,
<A HREF="
     cwg_defects.html#1313">1313</A>, <A HREF="
     cwg_defects.html#1399">1399</A>, and
<A HREF="
     cwg_defects.html#1437">1437</A>. Changed the status of issues
<A HREF="
     cwg_defects.html#616">616</A>, <A HREF="
     cwg_defects.html#903">903</A>,
<A HREF="
     cwg_defects.html#1318">1318</A>, <A HREF="
     cwg_defects.html#1358">1358</A>, and
<A HREF="
     cwg_defects.html#1402">1402</A> in light of additional discussion.
Incorporated the results of the drafting review teleconference held
2012-08-13.  Moved <A HREF="
     cwg_closed.html#321">issue 321</A> to "dup" status.
Moved <A HREF="
     cwg_defects.html#591">issue 591</A> to "open" status after the
discussion in "dup" <A HREF="
     cwg_closed.html#1526">issue 1526</A>.  Added additional
examples to <A HREF="
     cwg_closed.html#203">issue 203</A>.
Added new issues
<A HREF="
     cwg_defects.html#1467">1467</A>,
<A HREF="
     cwg_active.html#1468">1468</A>,
<A HREF="
     cwg_closed.html#1469">1469</A>,
<A HREF="
     cwg_closed.html#1470">1470</A>,
<A HREF="
     cwg_defects.html#1471">1471</A>,
<A HREF="
     cwg_defects.html#1472">1472</A>,
<A HREF="
     cwg_defects.html#1473">1473</A>,
<A HREF="
     cwg_closed.html#1474">1474</A>,
<A HREF="
     cwg_defects.html#1475">1475</A>,
<A HREF="
     cwg_defects.html#1476">1476</A>,
<A HREF="
     cwg_defects.html#1477">1477</A>,
<A HREF="
     cwg_active.html#1478">1478</A>,
<A HREF="
     cwg_defects.html#1479">1479</A>,
<A HREF="
     cwg_defects.html#1480">1480</A>,
<A HREF="
     cwg_defects.html#1481">1481</A>,
<A HREF="
     cwg_defects.html#1482">1482</A>,
<A HREF="
     cwg_closed.html#1483">1483</A>,
<A HREF="
     cwg_defects.html#1484">1484</A>,
<A HREF="
     cwg_active.html#1485">1485</A>,
<A HREF="
     cwg_active.html#1486">1486</A>,
<A HREF="
     cwg_defects.html#1487">1487</A>,
<A HREF="
     cwg_active.html#1488">1488</A>,
<A HREF="
     cwg_defects.html#1489">1489</A>,
<A HREF="
     cwg_defects.html#1490">1490</A>,
<A HREF="
     cwg_defects.html#1491">1491</A>,
<A HREF="
     cwg_defects.html#1492">1492</A>,
<A HREF="
     cwg_defects.html#1493">1493</A>,
<A HREF="
     cwg_defects.html#1494">1494</A>,
<A HREF="
     cwg_defects.html#1495">1495</A>,
<A HREF="
     cwg_active.html#1496">1496</A>,
<A HREF="
     cwg_closed.html#1497">1497</A>,
<A HREF="
     cwg_closed.html#1498">1498</A>,
<A HREF="
     cwg_active.html#1499">1499</A>,
<A HREF="
     cwg_active.html#1500">1500</A>,
<A HREF="
     cwg_closed.html#1501">1501</A>,
<A HREF="
     cwg_defects.html#1502">1502</A>,
<A HREF="
     cwg_defects.html#1503">1503</A>,
<A HREF="
     cwg_defects.html#1504">1504</A>,
<A HREF="
     cwg_closed.html#1505">1505</A>,
<A HREF="
     cwg_defects.html#1506">1506</A>,
<A HREF="
     cwg_defects.html#1507">1507</A>,
<A HREF="
     cwg_defects.html#1508">1508</A>,
<A HREF="
     cwg_defects.html#1509">1509</A>,
<A HREF="
     cwg_defects.html#1510">1510</A>,
<A HREF="
     cwg_defects.html#1511">1511</A>,
<A HREF="
     cwg_defects.html#1512">1512</A>,
<A HREF="
     cwg_active.html#1513">1513</A>,
<A HREF="
     cwg_defects.html#1514">1514</A>,
<A HREF="
     cwg_defects.html#1515">1515</A>,
<A HREF="
     cwg_defects.html#1516">1516</A>,
<A HREF="
     cwg_active.html#1517">1517</A>,
<A HREF="
     cwg_active.html#1518">1518</A>,
<A HREF="
     cwg_closed.html#1519">1519</A>,
<A HREF="
     cwg_closed.html#1520">1520</A>,
<A HREF="
     cwg_active.html#1521">1521</A>,
<A HREF="
     cwg_defects.html#1522">1522</A>,
<A HREF="
     cwg_active.html#1523">1523</A>,
<A HREF="
     cwg_active.html#1524">1524</A>,
<A HREF="
     cwg_closed.html#1525">1525</A>,
<A HREF="
     cwg_closed.html#1526">1526</A>,
<A HREF="
     cwg_defects.html#1527">1527</A>,
<A HREF="
     cwg_defects.html#1528">1528</A>,
<A HREF="
     cwg_active.html#1529">1529</A>,
<A HREF="
     cwg_active.html#1530">1530</A>,
<A HREF="
     cwg_defects.html#1531">1531</A>,
<A HREF="
     cwg_defects.html#1532">1532</A>,
<A HREF="
     cwg_defects.html#1533">1533</A>,
<A HREF="
     cwg_closed.html#1534">1534</A>,
<A HREF="
     cwg_defects.html#1535">1535</A>,
<A HREF="
     cwg_active.html#1536">1536</A>,
<A HREF="
     cwg_defects.html#1537">1537</A>,
<A HREF="
     cwg_defects.html#1538">1538</A>,
<A HREF="
     cwg_defects.html#1539">1539</A>,
<A HREF="
     cwg_closed.html#1540">1540</A>,
<A HREF="
     cwg_defects.html#1541">1541</A>,
<A HREF="
     cwg_active.html#1542">1542</A>,
<A HREF="
     cwg_defects.html#1543">1543</A>,
<A HREF="
     cwg_defects.html#1544">1544</A>,
<A HREF="
     cwg_active.html#1545">1545</A>,
<A HREF="
     cwg_closed.html#1546">1546</A>,
<A HREF="
     cwg_closed.html#1547">1547</A>,
<A HREF="
     cwg_active.html#1548">1548</A>,
<A HREF="
     cwg_active.html#1549">1549</A>,
<A HREF="
     cwg_defects.html#1550">1550</A>,
<A HREF="
     cwg_defects.html#1551">1551</A>,
<A HREF="
     cwg_defects.html#1552">1552</A>,
<A HREF="
     cwg_defects.html#1553">1553</A>,
<A HREF="
     cwg_active.html#1554">1554</A>,
<A HREF="
     cwg_closed.html#1555">1555</A>,
<A HREF="
     cwg_defects.html#1556">1556</A>,
<A HREF="
     cwg_defects.html#1557">1557</A>,
<A HREF="
     cwg_defects.html#1558">1558</A>, and
<A HREF="
     cwg_defects.html#1559">1559</A>.
</LI>

<LI><B>Revision 79, 2012-02-27:</B> Reflected deliberations at the
February, 2012 (Kona) meeting.
Added descriptions omitted from some issues
added in revision 77.  Moved <A HREF="
     cwg_closed.html#1427">issue 1427</A> to
"NAD" status. Moved <A HREF="
     cwg_closed.html#1377">issue 1377</A> to "dup" status
(with respect to <A HREF="
     cwg_active.html#1279">issue 1279</A>).
Moved <A HREF="
     cwg_closed.html#1422">issue 1422</A> to "dup"
status (with respect to <A HREF="
     cwg_defects.html#912">issue 912</A>). Added a
new status, "concurrency", to track issues that will be considered and
resolved by the Concurrency Working Group.
Added new issues
<A HREF="
     cwg_active.html#1444">1444</A>,
<A HREF="
     cwg_closed.html#1445">1445</A>,
<A HREF="
     cwg_defects.html#1446">1446</A>,
<A HREF="
     cwg_defects.html#1447">1447</A>,
<A HREF="
     cwg_closed.html#1448">1448</A>,
<A HREF="
     cwg_defects.html#1449">1449</A>,
<A HREF="
     cwg_defects.html#1450">1450</A>,
<A HREF="
     cwg_closed.html#1451">1451</A>,
<A HREF="
     cwg_active.html#1452">1452</A>,
<A HREF="
     cwg_defects.html#1453">1453</A>,
<A HREF="
     cwg_defects.html#1454">1454</A>,
<A HREF="
     cwg_defects.html#1455">1455</A>,
<A HREF="
     cwg_defects.html#1456">1456</A>,
<A HREF="
     cwg_defects.html#1457">1457</A>,
<A HREF="
     cwg_defects.html#1458">1458</A>,
<A HREF="
     cwg_active.html#1459">1459</A>,
<A HREF="
     cwg_defects.html#1460">1460</A>,
<A HREF="
     cwg_closed.html#1461">1461</A>,
<A HREF="
     cwg_defects.html#1462">1462</A>,
<A HREF="
     cwg_closed.html#1463">1463</A>,
<A HREF="
     cwg_defects.html#1464">1464</A>,
<A HREF="
     cwg_defects.html#1465">1465</A>, and
<A HREF="
     cwg_defects.html#1466">1466</A>.
</LI>

<LI><B>Revision 78, 2012-01-17:</B> Reflected the results of the
December 5, 2011 teleconference.
Changed the status of issues
<A HREF="
     cwg_defects.html#496">496</A>,
<A HREF="
     cwg_defects.html#675">675</A>,
<A HREF="
     cwg_defects.html#739">739</A>,
<A HREF="
     cwg_defects.html#1268">1268</A>,
<A HREF="
     cwg_defects.html#1269">1269</A>,
<A HREF="
     cwg_defects.html#1287">1287</A>, and
<A HREF="
     cwg_defects.html#1312">1312</A> from "ready" to "review" in response to
further discussion of the proposed resolutions.
Added new issues
<A HREF="
     cwg_defects.html#1370">1370</A>,
<A HREF="
     cwg_closed.html#1371">1371</A>,
<A HREF="
     cwg_defects.html#1372">1372</A>,
<A HREF="
     cwg_closed.html#1373">1373</A>,
<A HREF="
     cwg_defects.html#1374">1374</A>,
<A HREF="
     cwg_defects.html#1375">1375</A>,
<A HREF="
     cwg_defects.html#1376">1376</A>,
<A HREF="
     cwg_closed.html#1377">1377</A>,
<A HREF="
     cwg_active.html#1378">1378</A>,
<A HREF="
     cwg_closed.html#1379">1379</A>,
<A HREF="
     cwg_defects.html#1380">1380</A>,
<A HREF="
     cwg_defects.html#1381">1381</A>,
<A HREF="
     cwg_defects.html#1382">1382</A>,
<A HREF="
     cwg_defects.html#1383">1383</A>,
<A HREF="
     cwg_closed.html#1384">1384</A>,
<A HREF="
     cwg_defects.html#1385">1385</A>,
<A HREF="
     cwg_closed.html#1386">1386</A>,
<A HREF="
     cwg_defects.html#1387">1387</A>,
<A HREF="
     cwg_defects.html#1388">1388</A>,
<A HREF="
     cwg_closed.html#1389">1389</A>,
<A HREF="
     cwg_active.html#1390">1390</A>,
<A HREF="
     cwg_active.html#1391">1391</A>,
<A HREF="
     cwg_defects.html#1392">1392</A>,
<A HREF="
     cwg_closed.html#1393">1393</A>,
<A HREF="
     cwg_defects.html#1394">1394</A>,
<A HREF="
     cwg_active.html#1395">1395</A>,
<A HREF="
     cwg_active.html#1396">1396</A>,
<A HREF="
     cwg_defects.html#1397">1397</A>,
<A HREF="
     cwg_defects.html#1398">1398</A>,
<A HREF="
     cwg_defects.html#1399">1399</A>,
<A HREF="
     cwg_closed.html#1400">1400</A>,
<A HREF="
     cwg_defects.html#1401">1401</A>,
<A HREF="
     cwg_defects.html#1402">1402</A>,
<A HREF="
     cwg_active.html#1403">1403</A>,
<A HREF="
     cwg_active.html#1404">1404</A>,
<A HREF="
     cwg_defects.html#1405">1405</A>,
<A HREF="
     cwg_defects.html#1406">1406</A>,
<A HREF="
     cwg_closed.html#1407">1407</A>,
<A HREF="
     cwg_defects.html#1408">1408</A>,
<A HREF="
     cwg_defects.html#1409">1409</A>,
<A HREF="
     cwg_defects.html#1410">1410</A>,
<A HREF="
     cwg_defects.html#1411">1411</A>,
<A HREF="
     cwg_defects.html#1412">1412</A>,
<A HREF="
     cwg_defects.html#1413">1413</A>,
<A HREF="
     cwg_active.html#1414">1414</A>,
<A HREF="
     cwg_defects.html#1415">1415</A>,
<A HREF="
     cwg_defects.html#1416">1416</A>,
<A HREF="
     cwg_defects.html#1417">1417</A>,
<A HREF="
     cwg_defects.html#1418">1418</A>,
<A HREF="
     cwg_closed.html#1419">1419</A>,
<A HREF="
     cwg_closed.html#1420">1420</A>,
<A HREF="
     cwg_closed.html#1421">1421</A>,
<A HREF="
     cwg_closed.html#1422">1422</A>,
<A HREF="
     cwg_defects.html#1423">1423</A>,
<A HREF="
     cwg_defects.html#1424">1424</A>,
<A HREF="
     cwg_defects.html#1425">1425</A>,
<A HREF="
     cwg_closed.html#1426">1426</A>,
<A HREF="
     cwg_closed.html#1427">1427</A>,
<A HREF="
     cwg_defects.html#1428">1428</A>,
<A HREF="
     cwg_closed.html#1429">1429</A>,
<A HREF="
     cwg_active.html#1430">1430</A>,
<A HREF="
     cwg_defects.html#1431">1431</A>,
<A HREF="
     cwg_active.html#1432">1432</A>,
<A HREF="
     cwg_closed.html#1433">1433</A>,
<A HREF="
     cwg_closed.html#1434">1434</A>,
<A HREF="
     cwg_defects.html#1435">1435</A>,
<A HREF="
     cwg_active.html#1436">1436</A>,
<A HREF="
     cwg_defects.html#1437">1437</A>,
<A HREF="
     cwg_defects.html#1438">1438</A>,
<A HREF="
     cwg_defects.html#1439">1439</A>,
<A HREF="
     cwg_defects.html#1440">1440</A>,
<A HREF="
     cwg_defects.html#1441">1441</A>,
<A HREF="
     cwg_defects.html#1442">1442</A>, and
<A HREF="
     cwg_closed.html#1443">1443</A>.
</LI>

<LI><B>Revision 77, 2011-09-06:</B> Reflected the deliberations of the
August, 2011 (Bloomington) meeting.  Added new issues
<A HREF="
     cwg_active.html#1247">1247</A>,
<A HREF="
     cwg_active.html#1248">1248</A>,
<A HREF="
     cwg_active.html#1249">1249</A>,
<A HREF="
     cwg_defects.html#1250">1250</A>,
<A HREF="
     cwg_defects.html#1251">1251</A>,
<A HREF="
     cwg_active.html#1252">1252</A>,
<A HREF="
     cwg_active.html#1253">1253</A>,
<A HREF="
     cwg_closed.html#1254">1254</A>,
<A HREF="
     cwg_active.html#1255">1255</A>,
<A HREF="
     cwg_active.html#1256">1256</A>,
<A HREF="
     cwg_active.html#1257">1257</A>,
<A HREF="
     cwg_active.html#1258">1258</A>,
<A HREF="
     cwg_closed.html#1259">1259</A>,
<A HREF="
     cwg_defects.html#1260">1260</A>,
<A HREF="
     cwg_defects.html#1261">1261</A>,
<A HREF="
     cwg_defects.html#1262">1262</A>,
<A HREF="
     cwg_closed.html#1263">1263</A>,
<A HREF="
     cwg_defects.html#1264">1264</A>,
<A HREF="
     cwg_defects.html#1265">1265</A>,
<A HREF="
     cwg_active.html#1266">1266</A>,
<A HREF="
     cwg_defects.html#1267">1267</A>,
<A HREF="
     cwg_defects.html#1268">1268</A>,
<A HREF="
     cwg_defects.html#1269">1269</A>,
<A HREF="
     cwg_defects.html#1270">1270</A>,
<A HREF="
     cwg_active.html#1271">1271</A>,
<A HREF="
     cwg_closed.html#1272">1272</A>,
<A HREF="
     cwg_closed.html#1273">1273</A>,
<A HREF="
     cwg_active.html#1274">1274</A>,
<A HREF="
     cwg_defects.html#1275">1275</A>,
<A HREF="
     cwg_closed.html#1276">1276</A>,
<A HREF="
     cwg_closed.html#1277">1277</A>,
<A HREF="
     cwg_active.html#1278">1278</A>,
<A HREF="
     cwg_active.html#1279">1279</A>,
<A HREF="
     cwg_closed.html#1280">1280</A>,
<A HREF="
     cwg_closed.html#1281">1281</A>,
<A HREF="
     cwg_defects.html#1282">1282</A>,
<A HREF="
     cwg_active.html#1283">1283</A>,
<A HREF="
     cwg_active.html#1284">1284</A>,
<A HREF="
     cwg_active.html#1285">1285</A>,
<A HREF="
     cwg_active.html#1286">1286</A>,
<A HREF="
     cwg_defects.html#1287">1287</A>,
<A HREF="
     cwg_defects.html#1288">1288</A>,
<A HREF="
     cwg_closed.html#1289">1289</A>,
<A HREF="
     cwg_defects.html#1290">1290</A>,
<A HREF="
     cwg_active.html#1291">1291</A>,
<A HREF="
     cwg_defects.html#1292">1292</A>,
<A HREF="
     cwg_defects.html#1293">1293</A>,
<A HREF="
     cwg_active.html#1294">1294</A>,
<A HREF="
     cwg_defects.html#1295">1295</A>,
<A HREF="
     cwg_defects.html#1296">1296</A>,
<A HREF="
     cwg_defects.html#1297">1297</A>,
<A HREF="
     cwg_defects.html#1298">1298</A>,
<A HREF="
     cwg_active.html#1299">1299</A>,
<A HREF="
     cwg_closed.html#1300">1300</A>,
<A HREF="
     cwg_defects.html#1301">1301</A>,
<A HREF="
     cwg_defects.html#1302">1302</A>,
<A HREF="
     cwg_closed.html#1303">1303</A>,
<A HREF="
     cwg_active.html#1304">1304</A>,
<A HREF="
     cwg_defects.html#1305">1305</A>,
<A HREF="
     cwg_defects.html#1306">1306</A>,
<A HREF="
     cwg_defects.html#1307">1307</A>,
<A HREF="
     cwg_defects.html#1308">1308</A>,
<A HREF="
     cwg_active.html#1309">1309</A>,
<A HREF="
     cwg_defects.html#1310">1310</A>,
<A HREF="
     cwg_defects.html#1311">1311</A>,
<A HREF="
     cwg_defects.html#1312">1312</A>,
<A HREF="
     cwg_defects.html#1313">1313</A>,
<A HREF="
     cwg_closed.html#1314">1314</A>,
<A HREF="
     cwg_active.html#1315">1315</A>,
<A HREF="
     cwg_closed.html#1316">1316</A>,
<A HREF="
     cwg_closed.html#1317">1317</A>,
<A HREF="
     cwg_defects.html#1318">1318</A>,
<A HREF="
     cwg_closed.html#1319">1319</A>,
<A HREF="
     cwg_defects.html#1320">1320</A>,
<A HREF="
     cwg_defects.html#1321">1321</A>,
<A HREF="
     cwg_active.html#1322">1322</A>,
<A HREF="
     cwg_closed.html#1323">1323</A>,
<A HREF="
     cwg_defects.html#1324">1324</A>,
<A HREF="
     cwg_closed.html#1325">1325</A>,
<A HREF="
     cwg_closed.html#1326">1326</A>,
<A HREF="
     cwg_defects.html#1327">1327</A>,
<A HREF="
     cwg_defects.html#1328">1328</A>,
<A HREF="
     cwg_defects.html#1329">1329</A>,
<A HREF="
     cwg_defects.html#1330">1330</A>,
<A HREF="
     cwg_closed.html#1331">1331</A>,
<A HREF="
     cwg_active.html#1332">1332</A>,
<A HREF="
     cwg_defects.html#1333">1333</A>,
<A HREF="
     cwg_closed.html#1334">1334</A>,
<A HREF="
     cwg_active.html#1335">1335</A>,
<A HREF="
     cwg_defects.html#1336">1336</A>,
<A HREF="
     cwg_closed.html#1337">1337</A>,
<A HREF="
     cwg_defects.html#1338">1338</A>,
<A HREF="
     cwg_closed.html#1339">1339</A>,
<A HREF="
     cwg_defects.html#1340">1340</A>,
<A HREF="
     cwg_active.html#1341">1341</A>,
<A HREF="
     cwg_active.html#1342">1342</A>,
<A HREF="
     cwg_active.html#1343">1343</A>,
<A HREF="
     cwg_defects.html#1344">1344</A>,
<A HREF="
     cwg_defects.html#1345">1345</A>,
<A HREF="
     cwg_defects.html#1346">1346</A>,
<A HREF="
     cwg_defects.html#1347">1347</A>,
<A HREF="
     cwg_active.html#1348">1348</A>,
<A HREF="
     cwg_closed.html#1349">1349</A>,
<A HREF="
     cwg_defects.html#1350">1350</A>,
<A HREF="
     cwg_defects.html#1351">1351</A>,
<A HREF="
     cwg_defects.html#1352">1352</A>,
<A HREF="
     cwg_active.html#1353">1353</A>,
<A HREF="
     cwg_defects.html#1354">1354</A>,
<A HREF="
     cwg_defects.html#1355">1355</A>,
<A HREF="
     cwg_defects.html#1356">1356</A>,
<A HREF="
     cwg_defects.html#1357">1357</A>,
<A HREF="
     cwg_defects.html#1358">1358</A>,
<A HREF="
     cwg_defects.html#1359">1359</A>,
<A HREF="
     cwg_active.html#1360">1360</A>,
<A HREF="
     cwg_defects.html#1361">1361</A>,
<A HREF="
     cwg_defects.html#1362">1362</A>,
<A HREF="
     cwg_defects.html#1363">1363</A>,
<A HREF="
     cwg_defects.html#1364">1364</A>,
<A HREF="
     cwg_defects.html#1365">1365</A>,
<A HREF="
     cwg_defects.html#1366">1366</A>,
<A HREF="
     cwg_defects.html#1367">1367</A>,
<A HREF="
     cwg_defects.html#1368">1368</A>, and
<A HREF="
     cwg_defects.html#1369">1369</A>.
(Note that many of the preceding issues are missing descriptions.
These will be provided in the next revision of the issues list.)
</LI>

<LI><B>Revision 76, 2011-04-10:</B> Reflected the results of the March
7, 2011 teleconference and the March, 2011 (Madrid) meeting, including
adding a new status, "FDIS," for issues that are resolved in the draft
advanced at that meeting for FDIS balloting. In respect for ISO rules
governing work during the balloting process, no new issues have been
included in this version of the list.</LI>

<LI><B>Revision 75, 2011-02-28:</B> Reflected results of two
between-meetings teleconferences, including moving a number of issues
to "tentatively ready" status.  Added drafting for a number of issues
and moved them to "review" status.  Reopened <A HREF="
     cwg_closed.html#109">issue 109</A> in light of recent discussion.  Moved <A HREF="
     cwg_active.html#1028">issue 1028</A> back to "open" status after further analysis.  Moved
issues <A HREF="
     cwg_defects.html#1109">1109</A> and <A HREF="
     cwg_defects.html#1127">1127</A>
to "DR" status, as they had been overlooked in the results of the
November, 2010 (Batavia) meeting.  Added new issues
<A HREF="
     cwg_defects.html#1227">1227</A>,
<A HREF="
     cwg_closed.html#1228">1228</A>,
<A HREF="
     cwg_defects.html#1229">1229</A>,
<A HREF="
     cwg_active.html#1230">1230</A>,
<A HREF="
     cwg_defects.html#1231">1231</A>,
<A HREF="
     cwg_defects.html#1232">1232</A>,
<A HREF="
     cwg_defects.html#1233">1233</A>,
<A HREF="
     cwg_defects.html#1234">1234</A>,
<A HREF="
     cwg_defects.html#1235">1235</A>,
<A HREF="
     cwg_defects.html#1236">1236</A>,
<A HREF="
     cwg_defects.html#1237">1237</A>,
<A HREF="
     cwg_defects.html#1238">1238</A>,
<A HREF="
     cwg_defects.html#1239">1239</A>,
<A HREF="
     cwg_defects.html#1240">1240</A>,
<A HREF="
     cwg_defects.html#1241">1241</A>,
<A HREF="
     cwg_defects.html#1242">1242</A>,
<A HREF="
     cwg_defects.html#1243">1243</A>,
<A HREF="
     cwg_defects.html#1244">1244</A>,
<A HREF="
     cwg_defects.html#1245">1245</A>, and
<A HREF="
     cwg_defects.html#1246">1246</A>.
</LI>

<LI><B>Revision 74, 2010-11-29:</B> Reflected deliberations at the
November, 2010 (Batavia) meeting.  Added new issues
<A HREF="
     cwg_active.html#1211">1211</A>,
<A HREF="
     cwg_defects.html#1212">1212</A>,
<A HREF="
     cwg_defects.html#1213">1213</A>,
<A HREF="
     cwg_defects.html#1214">1214</A>,
<A HREF="
     cwg_defects.html#1215">1215</A>,
<A HREF="
     cwg_defects.html#1216">1216</A>,
<A HREF="
     cwg_closed.html#1217">1217</A>,
<A HREF="
     cwg_defects.html#1218">1218</A>,
<A HREF="
     cwg_defects.html#1219">1219</A>,
<A HREF="
     cwg_defects.html#1220">1220</A>,
<A HREF="
     cwg_active.html#1221">1221</A>,
<A HREF="
     cwg_closed.html#1222">1222</A>,
<A HREF="
     cwg_active.html#1223">1223</A>,
<A HREF="
     cwg_defects.html#1224">1224</A>,
<A HREF="
     cwg_defects.html#1225">1225</A>, and
<A HREF="
     cwg_defects.html#1226">1226</A>.
</LI>

<LI><B>Revision 73, 2010-10-18:</B> Moved issues
<A HREF="
     cwg_defects.html#994">994</A> and <A HREF="
     cwg_closed.html#1058">1058</A>
back to "open" status for potential reconsideration. Added analysis to
<A HREF="
     cwg_active.html#1038">issue 1038</A>. Moved issues
<A HREF="
     cwg_defects.html#1125">1125</A> and <A HREF="
     cwg_defects.html#1127">1127</A>
back to "drafting" status after further discussion revealed problems
with the proposed resolution approved at the August, 2010 meeting.
Moved <A HREF="
     cwg_defects.html#1167">issue 1167</A> to "review" status to
allow consideration of extending the resolution to cover a new but
related question. Reflected results of two between-meetings teleconferences,
including moving a number of issues to "tentatively ready" status.
Added new issues
<A HREF="
     cwg_defects.html#1174">1174</A>,
<A HREF="
     cwg_defects.html#1175">1175</A>,
<A HREF="
     cwg_defects.html#1176">1176</A>,
<A HREF="
     cwg_defects.html#1177">1177</A>,
<A HREF="
     cwg_defects.html#1178">1178</A>,
<A HREF="
     cwg_closed.html#1179">1179</A>,
<A HREF="
     cwg_defects.html#1180">1180</A>,
<A HREF="
     cwg_defects.html#1181">1181</A>,
<A HREF="
     cwg_defects.html#1182">1182</A>,
<A HREF="
     cwg_defects.html#1183">1183</A>,
<A HREF="
     cwg_defects.html#1184">1184</A>,
<A HREF="
     cwg_defects.html#1185">1185</A>,
<A HREF="
     cwg_defects.html#1186">1186</A>,
<A HREF="
     cwg_defects.html#1187">1187</A>,
<A HREF="
     cwg_defects.html#1188">1188</A>,
<A HREF="
     cwg_defects.html#1189">1189</A>,
<A HREF="
     cwg_defects.html#1190">1190</A>,
<A HREF="
     cwg_defects.html#1191">1191</A>,
<A HREF="
     cwg_defects.html#1192">1192</A>,
<A HREF="
     cwg_defects.html#1193">1193</A>,
<A HREF="
     cwg_defects.html#1194">1194</A>,
<A HREF="
     cwg_defects.html#1195">1195</A>,
<A HREF="
     cwg_defects.html#1196">1196</A>,
<A HREF="
     cwg_defects.html#1197">1197</A>,
<A HREF="
     cwg_defects.html#1198">1198</A>,
<A HREF="
     cwg_defects.html#1199">1199</A>,
<A HREF="
     cwg_active.html#1200">1200</A>,
<A HREF="
     cwg_defects.html#1201">1201</A>,
<A HREF="
     cwg_defects.html#1202">1202</A>,
<A HREF="
     cwg_closed.html#1203">1203</A>,
<A HREF="
     cwg_defects.html#1204">1204</A>,
<A HREF="
     cwg_closed.html#1205">1205</A>,
<A HREF="
     cwg_defects.html#1206">1206</A>,
<A HREF="
     cwg_defects.html#1207">1207</A>,
<A HREF="
     cwg_defects.html#1208">1208</A>,
<A HREF="
     cwg_active.html#1209">1209</A>, and
<A HREF="
     cwg_defects.html#1210">1210</A>,
</LI>

<LI><B>Revision 72, 2010-08-23:</B> Reflected deliberations at the
August, 2010 (Rapperswil) meeting. Added new issues
<A HREF="
     cwg_defects.html#1091">1091</A>,
<A HREF="
     cwg_active.html#1092">1092</A>,
<A HREF="
     cwg_defects.html#1093">1093</A>,
<A HREF="
     cwg_defects.html#1094">1094</A>,
<A HREF="
     cwg_defects.html#1095">1095</A>,
<A HREF="
     cwg_defects.html#1096">1096</A>,
<A HREF="
     cwg_closed.html#1097">1097</A>,
<A HREF="
     cwg_defects.html#1098">1098</A>,
<A HREF="
     cwg_defects.html#1099">1099</A>,
<A HREF="
     cwg_defects.html#1100">1100</A>,
<A HREF="
     cwg_defects.html#1101">1101</A>,
<A HREF="
     cwg_defects.html#1102">1102</A>,
<A HREF="
     cwg_defects.html#1103">1103</A>,
<A HREF="
     cwg_defects.html#1104">1104</A>,
<A HREF="
     cwg_defects.html#1105">1105</A>,
<A HREF="
     cwg_defects.html#1106">1106</A>,
<A HREF="
     cwg_defects.html#1107">1107</A>,
<A HREF="
     cwg_closed.html#1108">1108</A>,
<A HREF="
     cwg_defects.html#1109">1109</A>,
<A HREF="
     cwg_closed.html#1110">1110</A>,
<A HREF="
     cwg_defects.html#1111">1111</A>,
<A HREF="
     cwg_defects.html#1112">1112</A>,
<A HREF="
     cwg_defects.html#1113">1113</A>,
<A HREF="
     cwg_defects.html#1114">1114</A>,
<A HREF="
     cwg_defects.html#1115">1115</A>,
<A HREF="
     cwg_active.html#1116">1116</A>,
<A HREF="
     cwg_defects.html#1117">1117</A>,
<A HREF="
     cwg_closed.html#1118">1118</A>,
<A HREF="
     cwg_defects.html#1119">1119</A>,
<A HREF="
     cwg_defects.html#1120">1120</A>,
<A HREF="
     cwg_defects.html#1121">1121</A>,
<A HREF="
     cwg_defects.html#1122">1122</A>,
<A HREF="
     cwg_defects.html#1123">1123</A>,
<A HREF="
     cwg_closed.html#1124">1124</A>,
<A HREF="
     cwg_defects.html#1125">1125</A>,
<A HREF="
     cwg_defects.html#1126">1126</A>,
<A HREF="
     cwg_defects.html#1127">1127</A>,
<A HREF="
     cwg_defects.html#1128">1128</A>,
<A HREF="
     cwg_defects.html#1129">1129</A>,
<A HREF="
     cwg_defects.html#1130">1130</A>,
<A HREF="
     cwg_defects.html#1131">1131</A>,
<A HREF="
     cwg_closed.html#1132">1132</A>,
<A HREF="
     cwg_defects.html#1133">1133</A>,
<A HREF="
     cwg_defects.html#1134">1134</A>,
<A HREF="
     cwg_defects.html#1135">1135</A>,
<A HREF="
     cwg_defects.html#1136">1136</A>,
<A HREF="
     cwg_defects.html#1137">1137</A>,
<A HREF="
     cwg_defects.html#1138">1138</A>,
<A HREF="
     cwg_defects.html#1139">1139</A>,
<A HREF="
     cwg_defects.html#1140">1140</A>,
<A HREF="
     cwg_closed.html#1141">1141</A>,
<A HREF="
     cwg_defects.html#1142">1142</A>,
<A HREF="
     cwg_closed.html#1143">1143</A>,
<A HREF="
     cwg_defects.html#1144">1144</A>,
<A HREF="
     cwg_defects.html#1145">1145</A>,
<A HREF="
     cwg_defects.html#1146">1146</A>,
<A HREF="
     cwg_defects.html#1147">1147</A>,
<A HREF="
     cwg_defects.html#1148">1148</A>,
<A HREF="
     cwg_defects.html#1149">1149</A>,
<A HREF="
     cwg_closed.html#1150">1150</A>,
<A HREF="
     cwg_defects.html#1151">1151</A>,
<A HREF="
     cwg_defects.html#1152">1152</A>,
<A HREF="
     cwg_defects.html#1153">1153</A>,
<A HREF="
     cwg_defects.html#1154">1154</A>,
<A HREF="
     cwg_defects.html#1155">1155</A>,
<A HREF="
     cwg_defects.html#1156">1156</A>,
<A HREF="
     cwg_active.html#1157">1157</A>,
<A HREF="
     cwg_defects.html#1158">1158</A>,
<A HREF="
     cwg_defects.html#1159">1159</A>,
<A HREF="
     cwg_defects.html#1160">1160</A>,
<A HREF="
     cwg_defects.html#1161">1161</A>,
<A HREF="
     cwg_closed.html#1162">1162</A>,
<A HREF="
     cwg_closed.html#1163">1163</A>,
<A HREF="
     cwg_defects.html#1164">1164</A>,
<A HREF="
     cwg_defects.html#1165">1165</A>,
<A HREF="
     cwg_defects.html#1166">1166</A>,
<A HREF="
     cwg_defects.html#1167">1167</A>,
<A HREF="
     cwg_defects.html#1168">1168</A>,
<A HREF="
     cwg_defects.html#1169">1169</A>,
<A HREF="
     cwg_defects.html#1170">1170</A>,
<A HREF="
     cwg_defects.html#1171">1171</A>,
<A HREF="
     cwg_active.html#1172">1172</A>, and
<A HREF="
     cwg_defects.html#1173">1173</A>.
</LI>

<LI><B>Revision 71, 2010-08-07:</B> Added new issues
<A HREF="
     cwg_defects.html#1069">1069</A>,
<A HREF="
     cwg_defects.html#1070">1070</A>,
<A HREF="
     cwg_defects.html#1071">1071</A>,
<A HREF="
     cwg_defects.html#1072">1072</A>,
<A HREF="
     cwg_defects.html#1073">1073</A>,
<A HREF="
     cwg_defects.html#1074">1074</A>,
<A HREF="
     cwg_defects.html#1075">1075</A>,
<A HREF="
     cwg_active.html#1076">1076</A>,
<A HREF="
     cwg_closed.html#1077">1077</A>,
<A HREF="
     cwg_closed.html#1078">1078</A>,
<A HREF="
     cwg_defects.html#1079">1079</A>,
<A HREF="
     cwg_defects.html#1080">1080</A>,
<A HREF="
     cwg_defects.html#1081">1081</A>,
<A HREF="
     cwg_defects.html#1082">1082</A>,
<A HREF="
     cwg_defects.html#1083">1083</A>,
<A HREF="
     cwg_closed.html#1084">1084</A>,
<A HREF="
     cwg_closed.html#1085">1085</A>,
<A HREF="
     cwg_defects.html#1086">1086</A>,
<A HREF="
     cwg_defects.html#1087">1087</A>,
<A HREF="
     cwg_defects.html#1088">1088</A>,
<A HREF="
     cwg_active.html#1089">1089</A>, and
<A HREF="
     cwg_defects.html#1090">1090</A>.
</LI>

<LI><B>Revision 70, 2010-08-06:</B> Reflected results of between-meetings
teleconference, including moving a number of issues to "tentatively ready"
status, updating proposed resolutions, and moving issues
<A HREF="
     cwg_defects.html#341">341</A>,
<A HREF="
     cwg_defects.html#355">355</A>,
<A HREF="
     cwg_active.html#472">472</A>, and
<A HREF="
     cwg_active.html#529">529</A> to "drafting" status for more work.
Changed <A HREF="
     cwg_defects.html#979">issue 979</A> to "CD2" status, which
was overlooked in the results of the March, 2010 meeting.  Closed issues
<A HREF="
     cwg_closed.html#1041">1041</A>, <A HREF="
     cwg_closed.html#1019">1019</A>, and
<A HREF="
     cwg_closed.html#507">507</A> as duplicates of issues
<A HREF="
     cwg_defects.html#924">924</A>, <A HREF="
     cwg_active.html#314">314</A>, and
<A HREF="
     cwg_active.html#260">260</A>, respectively.
</LI>

<LI><B>Revision 69, 2010-03-29:</B> Reflected deliberations at the March,
2010 (Pittsburgh, PA) meeting.  Placed all issues with "WP" status and
newly-approved "DR" issues into "CD2" status, to reflect advancing the
Final Committee Draft for balloting. Added new issues
<A HREF="
     cwg_active.html#1001">1001</A>,
<A HREF="
     cwg_closed.html#1002">1002</A>,
<A HREF="
     cwg_defects.html#1003">1003</A>,
<A HREF="
     cwg_defects.html#1004">1004</A>,
<A HREF="
     cwg_closed.html#1005">1005</A>,
<A HREF="
     cwg_defects.html#1006">1006</A>,
<A HREF="
     cwg_closed.html#1007">1007</A>,
<A HREF="
     cwg_closed.html#1008">1008</A>,
<A HREF="
     cwg_defects.html#1009">1009</A>,
<A HREF="
     cwg_defects.html#1010">1010</A>,
<A HREF="
     cwg_defects.html#1011">1011</A>,
<A HREF="
     cwg_defects.html#1012">1012</A>,
<A HREF="
     cwg_defects.html#1013">1013</A>,
<A HREF="
     cwg_closed.html#1014">1014</A>,
<A HREF="
     cwg_defects.html#1015">1015</A>,
<A HREF="
     cwg_defects.html#1016">1016</A>,
<A HREF="
     cwg_defects.html#1017">1017</A>,
<A HREF="
     cwg_defects.html#1018">1018</A>,
<A HREF="
     cwg_closed.html#1019">1019</A>,
<A HREF="
     cwg_defects.html#1020">1020</A>,
<A HREF="
     cwg_defects.html#1021">1021</A>,
<A HREF="
     cwg_defects.html#1022">1022</A>,
<A HREF="
     cwg_closed.html#1023">1023</A>,
<A HREF="
     cwg_defects.html#1024">1024</A>,
<A HREF="
     cwg_defects.html#1025">1025</A>,
<A HREF="
     cwg_closed.html#1026">1026</A>,
<A HREF="
     cwg_active.html#1027">1027</A>,
<A HREF="
     cwg_active.html#1028">1028</A>,
<A HREF="
     cwg_defects.html#1029">1029</A>,
<A HREF="
     cwg_defects.html#1030">1030</A>,
<A HREF="
     cwg_defects.html#1031">1031</A>,
<A HREF="
     cwg_defects.html#1032">1032</A>,
<A HREF="
     cwg_defects.html#1033">1033</A>,
<A HREF="
     cwg_defects.html#1034">1034</A>,
<A HREF="
     cwg_defects.html#1035">1035</A>,
<A HREF="
     cwg_defects.html#1036">1036</A>,
<A HREF="
     cwg_defects.html#1037">1037</A>,
<A HREF="
     cwg_active.html#1038">1038</A>,
<A HREF="
     cwg_closed.html#1039">1039</A>,
<A HREF="
     cwg_closed.html#1040">1040</A>,
<A HREF="
     cwg_closed.html#1041">1041</A>,
<A HREF="
     cwg_defects.html#1042">1042</A>,
<A HREF="
     cwg_defects.html#1043">1043</A>,
<A HREF="
     cwg_defects.html#1044">1044</A>,
<A HREF="
     cwg_closed.html#1045">1045</A>,
<A HREF="
     cwg_active.html#1046">1046</A>,
<A HREF="
     cwg_defects.html#1047">1047</A>,
<A HREF="
     cwg_defects.html#1048">1048</A>,
<A HREF="
     cwg_active.html#1049">1049</A>,
<A HREF="
     cwg_closed.html#1050">1050</A>,
<A HREF="
     cwg_defects.html#1051">1051</A>,
<A HREF="
     cwg_closed.html#1052">1052</A>,
<A HREF="
     cwg_closed.html#1053">1053</A>,
<A HREF="
     cwg_defects.html#1054">1054</A>,
<A HREF="
     cwg_defects.html#1055">1055</A>,
<A HREF="
     cwg_defects.html#1056">1056</A>,
<A HREF="
     cwg_defects.html#1057">1057</A>,
<A HREF="
     cwg_closed.html#1058">1058</A>,
<A HREF="
     cwg_defects.html#1059">1059</A>,
<A HREF="
     cwg_defects.html#1060">1060</A>,
<A HREF="
     cwg_defects.html#1061">1061</A>,
<A HREF="
     cwg_defects.html#1062">1062</A>,
<A HREF="
     cwg_defects.html#1063">1063</A>,
<A HREF="
     cwg_defects.html#1064">1064</A>,
<A HREF="
     cwg_defects.html#1065">1065</A>,
<A HREF="
     cwg_defects.html#1066">1066</A>,
<A HREF="
     cwg_closed.html#1067">1067</A>, and
<A HREF="
     cwg_defects.html#1068">1068</A>.
</LI>

<LI><B>Revision 68, 2010-02-16:</B> Reflected results of between-meeting
teleconferences, including moving many issues to "tentatively ready" status
and incorporating draft proposed resolutions for many others.  Added
new issues <A HREF="
     cwg_defects.html#999">999</A> and <A HREF="
     cwg_defects.html#1000">1000</A>.
</LI>

<LI><B>Revision 67, 2009-11-08:</B> Reflected deliberations at the October,
2009 (Santa Cruz, CA) meeting. Added new issues
<A HREF="
     cwg_defects.html#972">972</A>,
<A HREF="
     cwg_defects.html#973">973</A>,
<A HREF="
     cwg_defects.html#974">974</A>,
<A HREF="
     cwg_defects.html#975">975</A>,
<A HREF="
     cwg_defects.html#976">976</A>,
<A HREF="
     cwg_defects.html#977">977</A>,
<A HREF="
     cwg_defects.html#978">978</A>,
<A HREF="
     cwg_defects.html#979">979</A>,
<A HREF="
     cwg_defects.html#980">980</A>,
<A HREF="
     cwg_defects.html#981">981</A>,
<A HREF="
     cwg_closed.html#982">982</A>,
<A HREF="
     cwg_defects.html#983">983</A>,
<A HREF="
     cwg_defects.html#984">984</A>,
<A HREF="
     cwg_defects.html#985">985</A>,
<A HREF="
     cwg_defects.html#986">986</A>,
<A HREF="
     cwg_defects.html#987">987</A>,
<A HREF="
     cwg_defects.html#988">988</A>,
<A HREF="
     cwg_defects.html#989">989</A>,
<A HREF="
     cwg_defects.html#990">990</A>,
<A HREF="
     cwg_defects.html#991">991</A>,
<A HREF="
     cwg_closed.html#992">992</A>,
<A HREF="
     cwg_defects.html#993">993</A>,
<A HREF="
     cwg_defects.html#994">994</A>,
<A HREF="
     cwg_defects.html#995">995</A>,
<A HREF="
     cwg_defects.html#996">996</A>,
<A HREF="
     cwg_defects.html#997">997</A>, and
<A HREF="
     cwg_closed.html#998">998</A>.
</LI>

<LI><B>Revision 66, 2009-09-29:</B> Incorporated a new status,
"tentatively ready", for issues whose resolutions were reviewed and
approved by teleconference between meetings. Changed
<A HREF="
     cwg_defects.html#378">issue 378</A> to "CD1" status, as it was
resolved by the resolution of <A HREF="
     cwg_defects.html#276">issue 276</A>.
 Added new issues
<A HREF="
     cwg_active.html#949">949</A>,
<A HREF="
     cwg_defects.html#950">950</A>,
<A HREF="
     cwg_defects.html#951">951</A>,
<A HREF="
     cwg_active.html#952">952</A>,
<A HREF="
     cwg_defects.html#953">953</A>,
<A HREF="
     cwg_active.html#954">954</A>,
<A HREF="
     cwg_defects.html#955">955</A>,
<A HREF="
     cwg_defects.html#956">956</A>,
<A HREF="
     cwg_defects.html#957">957</A>,
<A HREF="
     cwg_closed.html#958">958</A>,
<A HREF="
     cwg_defects.html#959">959</A>,
<A HREF="
     cwg_defects.html#960">960</A>,
<A HREF="
     cwg_defects.html#961">961</A>,
<A HREF="
     cwg_defects.html#962">962</A>,
<A HREF="
     cwg_defects.html#963">963</A>,
<A HREF="
     cwg_defects.html#964">964</A>,
<A HREF="
     cwg_defects.html#965">965</A>,
<A HREF="
     cwg_defects.html#966">966</A>,
<A HREF="
     cwg_closed.html#967">967</A>,
<A HREF="
     cwg_defects.html#968">968</A>,
<A HREF="
     cwg_defects.html#969">969</A>,
<A HREF="
     cwg_defects.html#970">970</A>, and
<A HREF="
     cwg_defects.html#971">971</A>.
</LI>

<LI><B>Revision 65, 2009-08-03:</B> Reflected deliberations from the
Frankfurt, Germany (July, 2009) meeting.  Added a new status,
"concepts," for issues related to the concepts proposal that was
removed from the working document and moved all concepts-related
issues to that status, effectively closing them.
 Changed the presentation of proposed
resolutions to use background colors in addition to font effects to
identify changes (i.e., <SPAN style="font-weight:bold;background-color:#A0FFA0">inserted</SPAN> and <SPAN style="text-decoration:line-through;background-color:#FFA0A0">deleted</SPAN>
text). Added new issues
<A HREF="
     cwg_defects.html#922">922</A>,
<A HREF="
     cwg_defects.html#923">923</A>,
<A HREF="
     cwg_defects.html#924">924</A>,
<A HREF="
     cwg_active.html#925">925</A>,
<A HREF="
     cwg_defects.html#926">926</A>,
<A HREF="
     cwg_defects.html#927">927</A>,
<A HREF="
     cwg_defects.html#928">928</A>,
<A HREF="
     cwg_defects.html#929">929</A>,
<A HREF="
     cwg_defects.html#930">930</A>,
<A HREF="
     cwg_defects.html#931">931</A>,
<A HREF="
     cwg_defects.html#932">932</A>,
<A HREF="
     cwg_defects.html#933">933</A>,
<A HREF="
     cwg_defects.html#934">934</A>,
<A HREF="
     cwg_defects.html#935">935</A>,
<A HREF="
     cwg_defects.html#936">936</A>,
<A HREF="
     cwg_closed.html#937">937</A>,
<A HREF="
     cwg_defects.html#938">938</A>,
<A HREF="
     cwg_defects.html#939">939</A>,
<A HREF="
     cwg_defects.html#940">940</A>,
<A HREF="
     cwg_defects.html#941">941</A>,
<A HREF="
     cwg_defects.html#942">942</A>,
<A HREF="
     cwg_active.html#943">943</A>,
<A HREF="
     cwg_active.html#944">944</A>,
<A HREF="
     cwg_defects.html#945">945</A>,
<A HREF="
     cwg_defects.html#946">946</A>,
<A HREF="
     cwg_closed.html#947">947</A>, and
<A HREF="
     cwg_defects.html#948">948</A>.
</LI>

<LI><B>Revision 64, 2009-06-19:</B> Fixed incorrect cross-references in
issues <A HREF="
     cwg_closed.html#867">867</A> and <A HREF="
     cwg_closed.html#868">868</A>.
Added proposed resolutions for issues
<A HREF="
     cwg_defects.html#527">527</A>,
<A HREF="
     cwg_defects.html#587">587</A>,
<A HREF="
     cwg_defects.html#589">589</A>,
<A HREF="
     cwg_defects.html#604">604</A>,
<A HREF="
     cwg_defects.html#719">719</A>,
<A HREF="
     cwg_defects.html#732">732</A>, and
<A HREF="
     cwg_defects.html#770">770</A>
and moved them to "review" status.  Added discussion to issues
<A HREF="
     cwg_defects.html#721">721</A>,
<A HREF="
     cwg_defects.html#760">760</A>,
<A HREF="
     cwg_closed.html#802">802</A>, and
<A HREF="
     cwg_defects.html#872">872</A>.  Added new issues
<A HREF="
     cwg_closed.html#889">889</A>,
<A HREF="
     cwg_closed.html#890">890</A>,
<A HREF="
     cwg_defects.html#891">891</A>,
<A HREF="
     cwg_defects.html#892">892</A>,
<A HREF="
     cwg_closed.html#893">893</A>,
<A HREF="
     cwg_closed.html#894">894</A>,
<A HREF="
     cwg_closed.html#895">895</A>,
<A HREF="
     cwg_defects.html#896">896</A>,
<A HREF="
     cwg_active.html#897">897</A>,
<A HREF="
     cwg_defects.html#898">898</A>,
<A HREF="
     cwg_defects.html#899">899</A>,
<A HREF="
     cwg_closed.html#900">900</A>,
<A HREF="
     cwg_active.html#901">901</A>,
<A HREF="
     cwg_closed.html#902">902</A>,
<A HREF="
     cwg_defects.html#903">903</A>,
<A HREF="
     cwg_defects.html#904">904</A>,
<A HREF="
     cwg_defects.html#905">905</A>,
<A HREF="
     cwg_defects.html#906">906</A>,
<A HREF="
     cwg_closed.html#907">907</A>,
<A HREF="
     cwg_defects.html#908">908</A>,
<A HREF="
     cwg_closed.html#909">909</A>,
<A HREF="
     cwg_defects.html#910">910</A>,
<A HREF="
     cwg_closed.html#911">911</A>,
<A HREF="
     cwg_defects.html#912">912</A>,
<A HREF="
     cwg_defects.html#913">913</A>,
<A HREF="
     cwg_closed.html#914">914</A>,
<A HREF="
     cwg_defects.html#915">915</A>,
<A HREF="
     cwg_active.html#916">916</A>,
<A HREF="
     cwg_closed.html#917">917</A>,
<A HREF="
     cwg_closed.html#918">918</A>,
<A HREF="
     cwg_defects.html#919">919</A>,
<A HREF="
     cwg_defects.html#920">920</A>, and
<A HREF="
     cwg_defects.html#921">921</A>.
</LI>

<LI><B>Revision 63, 2009-05-06:</B> Closed <A HREF="
     cwg_closed.html#839">issue 839</A> as a duplicate of <A HREF="
     cwg_defects.html#803">issue 803</A>.
Added notes to the discussion of issues <A HREF="
     cwg_active.html#325">325</A>,
<A HREF="
     cwg_defects.html#626">626</A>, <A HREF="
     cwg_defects.html#667">667</A>
<A HREF="
     cwg_defects.html#690">690</A>, <A HREF="
     cwg_defects.html#739">739</A>, and
<A HREF="
     cwg_closed.html#841">841</A>.  Moved <A HREF="
     cwg_closed.html#662">issue 662</A>
back to "open" status with additional discussion.  Added new issues
<A HREF="
     cwg_closed.html#843">843</A>,
<A HREF="
     cwg_closed.html#844">844</A>,
<A HREF="
     cwg_defects.html#845">845</A>,
<A HREF="
     cwg_defects.html#846">846</A>,
<A HREF="
     cwg_defects.html#847">847</A>,
<A HREF="
     cwg_closed.html#848">848</A>,
<A HREF="
     cwg_closed.html#849">849</A>,
<A HREF="
     cwg_defects.html#850">850</A>,
<A HREF="
     cwg_closed.html#851">851</A>,
<A HREF="
     cwg_active.html#852">852</A>,
<A HREF="
     cwg_defects.html#853">853</A>,
<A HREF="
     cwg_defects.html#854">854</A>,
<A HREF="
     cwg_defects.html#855">855</A>,
<A HREF="
     cwg_closed.html#856">856</A>,
<A HREF="
     cwg_closed.html#857">857</A>,
<A HREF="
     cwg_defects.html#858">858</A>,
<A HREF="
     cwg_closed.html#859">859</A>,
<A HREF="
     cwg_defects.html#860">860</A>,
<A HREF="
     cwg_defects.html#861">861</A>,
<A HREF="
     cwg_defects.html#862">862</A>,
<A HREF="
     cwg_defects.html#863">863</A>,
<A HREF="
     cwg_defects.html#864">864</A>,
<A HREF="
     cwg_defects.html#865">865</A>,
<A HREF="
     cwg_closed.html#866">866</A>,
<A HREF="
     cwg_closed.html#867">867</A>,
<A HREF="
     cwg_closed.html#868">868</A>,
<A HREF="
     cwg_defects.html#869">869</A>,
<A HREF="
     cwg_closed.html#870">870</A>,
<A HREF="
     cwg_closed.html#871">871</A>,
<A HREF="
     cwg_defects.html#872">872</A>,
<A HREF="
     cwg_defects.html#873">873</A>,
<A HREF="
     cwg_defects.html#874">874</A>,
<A HREF="
     cwg_closed.html#875">875</A>,
<A HREF="
     cwg_defects.html#876">876</A>,
<A HREF="
     cwg_defects.html#877">877</A>,
<A HREF="
     cwg_closed.html#878">878</A>,
<A HREF="
     cwg_defects.html#879">879</A>,
<A HREF="
     cwg_defects.html#880">880</A>,
<A HREF="
     cwg_closed.html#881">881</A>,
<A HREF="
     cwg_defects.html#882">882</A>,
<A HREF="
     cwg_defects.html#883">883</A>,
<A HREF="
     cwg_defects.html#884">884</A>,
<A HREF="
     cwg_closed.html#885">885</A>,
<A HREF="
     cwg_defects.html#886">886</A>,
<A HREF="
     cwg_defects.html#887">887</A>, and
<A HREF="
     cwg_defects.html#888">888</A>.
</LI>

<LI><B>Revision 62, 2009-03-23:</B> Reflected deliberations from the
Summit, NJ (March, 2009) meeting. Marked issues directly related to
National Body comments on the 2008-10 Committee Draft with a tag
identifying the relevant comment; the tag is both printed in the issue
body and reflected in the "Index by Status" document.  Added new
issues
<A HREF="
     cwg_defects.html#767">767</A>,
<A HREF="
     cwg_defects.html#768">768</A>,
<A HREF="
     cwg_defects.html#769">769</A>,
<A HREF="
     cwg_defects.html#770">770</A>,
<A HREF="
     cwg_defects.html#771">771</A>,
<A HREF="
     cwg_defects.html#772">772</A>,
<A HREF="
     cwg_defects.html#773">773</A>,
<A HREF="
     cwg_defects.html#774">774</A>,
<A HREF="
     cwg_defects.html#775">775</A>,
<A HREF="
     cwg_defects.html#776">776</A>,
<A HREF="
     cwg_defects.html#777">777</A>,
<A HREF="
     cwg_defects.html#778">778</A>,
<A HREF="
     cwg_defects.html#779">779</A>,
<A HREF="
     cwg_closed.html#780">780</A>,
<A HREF="
     cwg_closed.html#781">781</A>,
<A HREF="
     cwg_defects.html#782">782</A>,
<A HREF="
     cwg_active.html#783">783</A>,
<A HREF="
     cwg_defects.html#784">784</A>,
<A HREF="
     cwg_defects.html#785">785</A>,
<A HREF="
     cwg_defects.html#786">786</A>,
<A HREF="
     cwg_defects.html#787">787</A>,
<A HREF="
     cwg_defects.html#788">788</A>,
<A HREF="
     cwg_defects.html#789">789</A>,
<A HREF="
     cwg_defects.html#790">790</A>,
<A HREF="
     cwg_closed.html#791">791</A>,
<A HREF="
     cwg_defects.html#792">792</A>,
<A HREF="
     cwg_defects.html#793">793</A>,
<A HREF="
     cwg_closed.html#794">794</A>,
<A HREF="
     cwg_closed.html#795">795</A>,
<A HREF="
     cwg_defects.html#796">796</A>,
<A HREF="
     cwg_defects.html#797">797</A>,
<A HREF="
     cwg_defects.html#798">798</A>,
<A HREF="
     cwg_defects.html#799">799</A>,
<A HREF="
     cwg_closed.html#800">800</A>,
<A HREF="
     cwg_defects.html#801">801</A>,
<A HREF="
     cwg_closed.html#802">802</A>,
<A HREF="
     cwg_defects.html#803">803</A>,
<A HREF="
     cwg_defects.html#804">804</A>,
<A HREF="
     cwg_defects.html#805">805</A>,
<A HREF="
     cwg_defects.html#806">806</A>,
<A HREF="
     cwg_closed.html#807">807</A>,
<A HREF="
     cwg_defects.html#808">808</A>,
<A HREF="
     cwg_defects.html#809">809</A>,
<A HREF="
     cwg_defects.html#810">810</A>,
<A HREF="
     cwg_defects.html#811">811</A>,
<A HREF="
     cwg_defects.html#812">812</A>,
<A HREF="
     cwg_active.html#813">813</A>,
<A HREF="
     cwg_defects.html#814">814</A>,
<A HREF="
     cwg_defects.html#815">815</A>,
<A HREF="
     cwg_defects.html#816">816</A>,
<A HREF="
     cwg_defects.html#817">817</A>,
<A HREF="
     cwg_defects.html#818">818</A>,
<A HREF="
     cwg_closed.html#819">819</A>,
<A HREF="
     cwg_defects.html#820">820</A>,
<A HREF="
     cwg_closed.html#821">821</A>,
<A HREF="
     cwg_closed.html#822">822</A>,
<A HREF="
     cwg_defects.html#823">823</A>,
<A HREF="
     cwg_closed.html#824">824</A>,
<A HREF="
     cwg_closed.html#825">825</A>,
<A HREF="
     cwg_closed.html#826">826</A>,
<A HREF="
     cwg_closed.html#827">827</A>,
<A HREF="
     cwg_defects.html#828">828</A>,
<A HREF="
     cwg_closed.html#829">829</A>,
<A HREF="
     cwg_defects.html#830">830</A>,
<A HREF="
     cwg_defects.html#831">831</A>,
<A HREF="
     cwg_defects.html#832">832</A>,
<A HREF="
     cwg_defects.html#833">833</A>,
<A HREF="
     cwg_defects.html#834">834</A>,
<A HREF="
     cwg_defects.html#835">835</A>,
<A HREF="
     cwg_closed.html#836">836</A>,
<A HREF="
     cwg_defects.html#837">837</A>,
<A HREF="
     cwg_defects.html#838">838</A>,
<A HREF="
     cwg_closed.html#839">839</A>,
<A HREF="
     cwg_defects.html#840">840</A>,
<A HREF="
     cwg_closed.html#841">841</A>, and
<A HREF="
     cwg_defects.html#842">842</A>.
</LI>

<LI><B>Revision 61, 2009-02-08:</B> Provided a reference to a paper
containing a proposed resolution for issues <A HREF="
     cwg_defects.html#695">695</A>
and <A HREF="
     cwg_defects.html#699">699</A> and moved them to "review" status.
Added new issues
<A HREF="
     cwg_defects.html#749">749</A>,
<A HREF="
     cwg_defects.html#750">750</A>,
<A HREF="
     cwg_defects.html#751">751</A>,
<A HREF="
     cwg_defects.html#752">752</A>,
<A HREF="
     cwg_defects.html#753">753</A>,
<A HREF="
     cwg_defects.html#754">754</A>,
<A HREF="
     cwg_defects.html#755">755</A>,
<A HREF="
     cwg_defects.html#756">756</A>,
<A HREF="
     cwg_defects.html#757">757</A>,
<A HREF="
     cwg_defects.html#758">758</A>,
<A HREF="
     cwg_defects.html#759">759</A>,
<A HREF="
     cwg_defects.html#760">760</A>,
<A HREF="
     cwg_defects.html#761">761</A>,
<A HREF="
     cwg_defects.html#762">762</A>,
<A HREF="
     cwg_defects.html#763">763</A>,
<A HREF="
     cwg_defects.html#764">764</A>,
<A HREF="
     cwg_defects.html#765">765</A>, and
<A HREF="
     cwg_defects.html#766">766</A>.
</LI>

<LI><B>Revision 60, 2008-12-09:</B> Revised the resolution of
<A HREF="
     cwg_defects.html#653">issue 653</A> and moved to "review" status.
Added new issues
<A HREF="
     cwg_closed.html#724">724</A>,
<A HREF="
     cwg_closed.html#725">725</A>,
<A HREF="
     cwg_defects.html#726">726</A>,
<A HREF="
     cwg_active.html#727">727</A>,
<A HREF="
     cwg_closed.html#728">728</A>,
<A HREF="
     cwg_defects.html#729">729</A>,
<A HREF="
     cwg_defects.html#730">730</A>,
<A HREF="
     cwg_defects.html#731">731</A>,
<A HREF="
     cwg_defects.html#732">732</A>,
<A HREF="
     cwg_closed.html#733">733</A>,
<A HREF="
     cwg_defects.html#734">734</A>,
<A HREF="
     cwg_defects.html#735">735</A>,
<A HREF="
     cwg_closed.html#736">736</A>,
<A HREF="
     cwg_defects.html#737">737</A>,
<A HREF="
     cwg_defects.html#738">738</A>,
<A HREF="
     cwg_defects.html#739">739</A>,
<A HREF="
     cwg_defects.html#740">740</A>,
<A HREF="
     cwg_defects.html#741">741</A>,
<A HREF="
     cwg_active.html#742">742</A>,
<A HREF="
     cwg_defects.html#743">743</A>,
<A HREF="
     cwg_defects.html#744">744</A>,
<A HREF="
     cwg_active.html#745">745</A>,
<A HREF="
     cwg_defects.html#746">746</A>,
<A HREF="
     cwg_closed.html#747">747</A>, and
<A HREF="
     cwg_closed.html#748">748</A>.
</LI>

<LI><B>Revision 59, 2008-10-05:</B> Reflected deliberations from the
San Francisco (September, 2008) meeting. Placed all issues with
"WP" status and newly-approved "DR" issues into "CD1" status, to
reflect advancing the Committee Draft for balloting.  Added new
proposed resolutions to issues <A HREF="
     cwg_defects.html#696">696</A>,
<A HREF="
     cwg_defects.html#704">704</A>, and <A HREF="
     cwg_defects.html#705">705</A>
and moved them to "review" status. Changed
<A HREF="
     cwg_closed.html#265">issue 265</A> to "dup" status in favor of
<A HREF="
     cwg_defects.html#353">issue 353</A>, which was approved in 2003.
Added new issues
<A HREF="
     cwg_defects.html#710">710</A>,
<A HREF="
     cwg_defects.html#711">711</A>,
<A HREF="
     cwg_defects.html#712">712</A>,
<A HREF="
     cwg_defects.html#713">713</A>,
<A HREF="
     cwg_defects.html#714">714</A>,
<A HREF="
     cwg_defects.html#715">715</A>,
<A HREF="
     cwg_defects.html#716">716</A>,
<A HREF="
     cwg_defects.html#717">717</A>,
<A HREF="
     cwg_active.html#718">718</A>,
<A HREF="
     cwg_defects.html#719">719</A>,
<A HREF="
     cwg_defects.html#720">720</A>,
<A HREF="
     cwg_defects.html#721">721</A>,
<A HREF="
     cwg_defects.html#722">722</A>, and
<A HREF="
     cwg_closed.html#723">723</A>.
</LI>

<LI><B>Revision 58, 2008-08-25:</B> Fixed some incorrect section
references.  Fixed the title of <A HREF="
     cwg_defects.html#692">issue 692</A>.
Changed the status of <A HREF="
     cwg_defects.html#603">issue 603</A> to "WP",
as the paper that resolved it was approved in April, 2007.  Moved
<A HREF="
     cwg_defects.html#657">issue 657</A> back to "review" status and
added proposed wording. Added discussion to issues
<A HREF="
     cwg_defects.html#693">693</A> and <A HREF="
     cwg_active.html#697">697</A>.
Added or revised resolutions for issues
<A HREF="
     cwg_defects.html#606">606</A>,
<A HREF="
     cwg_defects.html#614">614</A>,
<A HREF="
     cwg_defects.html#652">652</A>,
<A HREF="
     cwg_defects.html#685">685</A>, and
<A HREF="
     cwg_defects.html#694">694</A> and moved them to "review" status.
Added new issues
<A HREF="
     cwg_defects.html#704">704</A>,
<A HREF="
     cwg_defects.html#705">705</A>,
<A HREF="
     cwg_closed.html#706">706</A>,
<A HREF="
     cwg_defects.html#707">707</A>,
<A HREF="
     cwg_active.html#708">708</A>, and
<A HREF="
     cwg_defects.html#709">709</A>.
</LI>

<LI><B>Revision 57, 2008-07-27:</B>  Updated the status of issues
<A HREF="
     cwg_defects.html#222">222</A>, <A HREF="
     cwg_defects.html#309">309</A>, and
<A HREF="
     cwg_defects.html#632">632</A> to reflect actions at the June, 2008
meeting that were inadvertently omitted in the preceding revision.
Added proposed wording for
<A HREF="
     cwg_defects.html#683">issue 683</A> and moved it to "review" status.
Added new issues
<A HREF="
     cwg_active.html#697">697</A>,
<A HREF="
     cwg_active.html#698">698</A>,
<A HREF="
     cwg_defects.html#699">699</A>,
<A HREF="
     cwg_defects.html#700">700</A>,
<A HREF="
     cwg_defects.html#701">701</A>,
<A HREF="
     cwg_defects.html#702">702</A>, and
<A HREF="
     cwg_defects.html#703">703</A>.
</LI>

<LI><B>Revision 56, 2008-06-29:</B> Reflected deliberations from the
Sophia Antipolis (June, 2008) meeting.  Added discussion to issues
<A HREF="
     cwg_closed.html#507">507</A> and
<A HREF="
     cwg_defects.html#527">527</A>. Added proposed resolution for
<A HREF="
     cwg_defects.html#653">issue 653</A>.  Added new issues
<A HREF="
     cwg_defects.html#695">695</A> and <A HREF="
     cwg_defects.html#696">696</A>.
</LI>

<LI><B>Revision 55, 2008-05-18:</B> Added proposed resolutions for
issues
<A HREF="
     cwg_defects.html#220">220</A>,
<A HREF="
     cwg_defects.html#257">257</A>,
<A HREF="
     cwg_defects.html#292">292</A>,
<A HREF="
     cwg_defects.html#341">341</A>,
<A HREF="
     cwg_defects.html#539">539</A>,
<A HREF="
     cwg_active.html#554">554</A>,
<A HREF="
     cwg_defects.html#570">570</A>,
<A HREF="
     cwg_defects.html#571">571</A>,
<A HREF="
     cwg_defects.html#576">576</A>,
<A HREF="
     cwg_defects.html#597">597</A>,
<A HREF="
     cwg_defects.html#621">621</A>,
<A HREF="
     cwg_defects.html#624">624</A>,
<A HREF="
     cwg_defects.html#626">626</A>,
<A HREF="
     cwg_defects.html#633">633</A>,
<A HREF="
     cwg_defects.html#634">634</A>,
<A HREF="
     cwg_defects.html#639">639</A>, and
<A HREF="
     cwg_defects.html#642">642</A>,
and moved them to "review" status.
Moved <A HREF="
     cwg_closed.html#155">issue 155</A> to "dup" status in
favor of <A HREF="
     cwg_defects.html#632">issue 632</A>, which was changed
to "review" status in light of its connection with the
initializer-list proposal.  Moved issues <A HREF="
     cwg_defects.html#530">530</A>
and <A HREF="
     cwg_defects.html#551">551</A>
to "WP" status because they were resolved by the constexpr proposal.
Moved <A HREF="
     cwg_closed.html#646">issue 646</A> to "review" status because
it appears to be "NAD".  Changed <A HREF="
     cwg_defects.html#240">issue 240</A>
to "review" status (from "ready") in light of input from WG14 regarding
a similar issue.  Added new issues
<A HREF="
     cwg_defects.html#685">685</A>,
<A HREF="
     cwg_defects.html#686">686</A>,
<A HREF="
     cwg_closed.html#687">687</A>,
<A HREF="
     cwg_defects.html#688">688</A>,
<A HREF="
     cwg_active.html#689">689</A>,
<A HREF="
     cwg_defects.html#690">690</A>,
<A HREF="
     cwg_defects.html#691">691</A>,
<A HREF="
     cwg_defects.html#692">692</A>,
<A HREF="
     cwg_defects.html#693">693</A>, and
<A HREF="
     cwg_defects.html#694">694</A>.
</LI>

<LI><B>Revision 54, 2008-03-17:</B> Reflected deliberations from the
Bellevue (February, 2008) meeting.  Restructured references inside
&#8220;definitions&#8221; sections (1.3 [intro.defs],
17.3 [definitions]) because the individual definitions are not
sections.  Returned <A HREF="
     cwg_closed.html#646">issue 646</A> to "open"
status (it was previously erroneously in "drafting" status).  Moved
issues <A HREF="
     cwg_closed.html#347">347</A>, <A HREF="
     cwg_closed.html#512">512</A>,
and <A HREF="
     cwg_closed.html#236">236</A> to "review" status with a
recommendation to close them as "NAD."  Changed issues <A HREF="
     cwg_defects.html#220">220</A> and <A HREF="
     cwg_defects.html#256">256</A> back to "open"
status  and
annotated them to indicate that they have been accepted by EWG and
referred to CWG for action for C++0x.  Changed issues <A HREF="
     cwg_active.html#6">6</A> and <A HREF="
     cwg_active.html#150">150</A> back to "open"
status  and
annotated them to indicate that they have been accepted by EWG and
referred to CWG for action, but not for C++0x. Closed issues
<A HREF="
     cwg_closed.html#107">107</A>,
<A HREF="
     cwg_closed.html#168">168</A>,
<A HREF="
     cwg_closed.html#229">229</A>,
<A HREF="
     cwg_closed.html#294">294</A>, and
<A HREF="
     cwg_closed.html#359">359</A> as "NAD" to reflect the recommendation
of EWG.  Added new issues
<A HREF="
     cwg_closed.html#673">673</A>,
<A HREF="
     cwg_defects.html#674">674</A>,
<A HREF="
     cwg_defects.html#675">675</A>,
<A HREF="
     cwg_defects.html#676">676</A>,
<A HREF="
     cwg_defects.html#677">677</A>,
<A HREF="
     cwg_defects.html#678">678</A>,
<A HREF="
     cwg_defects.html#679">679</A>,
<A HREF="
     cwg_defects.html#680">680</A>,
<A HREF="
     cwg_defects.html#681">681</A>,
<A HREF="
     cwg_active.html#682">682</A>,
<A HREF="
     cwg_defects.html#683">683</A>, and
<A HREF="
     cwg_defects.html#684">684</A>.
</LI>

<LI><B>Revision 53, 2008-02-03:</B>
Updated the proposed resolutions for issues <A HREF="
     cwg_defects.html#288">288</A>
and <A HREF="
     cwg_defects.html#342">342</A>.  Updated the status of issues
<A HREF="
     cwg_defects.html#199">199</A> and <A HREF="
     cwg_defects.html#430">430</A> to reflect
actions at the Oxford (April, 2007) meeting.
Added proposed resolutions and
changed the status to "review" for issues
<A HREF="
     cwg_defects.html#28">28</A>,
<A HREF="
     cwg_closed.html#111">111</A>,
<A HREF="
     cwg_defects.html#118">118</A>,
<A HREF="
     cwg_defects.html#141">141</A>,
<A HREF="
     cwg_defects.html#240">240</A>,
<A HREF="
     cwg_defects.html#276">276</A>,
<A HREF="
     cwg_defects.html#309">309</A>,
<A HREF="
     cwg_defects.html#355">355</A>,
<A HREF="
     cwg_defects.html#373">373</A>,
<A HREF="
     cwg_defects.html#378">378</A>,
<A HREF="
     cwg_defects.html#462">462</A>,
<A HREF="
     cwg_defects.html#485">485</A>,
<A HREF="
     cwg_defects.html#535">535</A>,
<A HREF="
     cwg_closed.html#574">574</A>,
<A HREF="
     cwg_defects.html#601">601</A>,
<A HREF="
     cwg_defects.html#608">608</A>,
<A HREF="
     cwg_defects.html#641">641</A>,
<A HREF="
     cwg_defects.html#645">645</A>, and
<A HREF="
     cwg_defects.html#651">651</A>.
Added new issues
<A HREF="
     cwg_defects.html#667">667</A>,
<A HREF="
     cwg_defects.html#668">668</A>,
<A HREF="
     cwg_closed.html#669">669</A>,
<A HREF="
     cwg_active.html#670">670</A>,
<A HREF="
     cwg_defects.html#671">671</A>, and
<A HREF="
     cwg_defects.html#672">672</A>.
</LI>

<LI><B>Revision 52, 2007-12-09:</B>
Updated the status of issues <A HREF="
     cwg_defects.html#568">568</A> and
<A HREF="
     cwg_defects.html#620">620</A> to reflect actions at the Toronto
(July, 2007) meeting. Fixed a typographical error in the example for
<A HREF="
     cwg_defects.html#606">issue 606</A>.
Added new issues
<A HREF="
     cwg_defects.html#654">654</A>,
<A HREF="
     cwg_defects.html#655">655</A>,
<A HREF="
     cwg_defects.html#656">656</A>,
<A HREF="
     cwg_defects.html#657">657</A>,
<A HREF="
     cwg_defects.html#658">658</A>,
<A HREF="
     cwg_defects.html#659">659</A>,
<A HREF="
     cwg_defects.html#660">660</A>,
<A HREF="
     cwg_defects.html#661">661</A>,
<A HREF="
     cwg_closed.html#662">662</A>,
<A HREF="
     cwg_defects.html#663">663</A>,
<A HREF="
     cwg_defects.html#664">664</A>,
<A HREF="
     cwg_defects.html#665">665</A>, and
<A HREF="
     cwg_defects.html#666">666</A>.
</LI>

<LI><B>Revision 51, 2007-10-09:</B> Reflected deliberations from the Kona
(October, 2007) meeting.  Added new issues
<A HREF="
     cwg_defects.html#652">652</A> and <A HREF="
     cwg_defects.html#653">653</A>.
</LI>

<LI><B>Revision 50, 2007-09-09:</B> Updated section reference numbers to use
the numbering of the most recent working draft and added text identifying
the document number of that draft at the beginning of each issues
list document.  Updated <A HREF="
     cwg_defects.html#475">issue 475</A>
with discussion regarding the point at which
<TT>std::uncaught_exception()</TT> becomes <TT>false</TT>.  Added new issues
<A HREF="
     cwg_defects.html#642">642</A>,
<A HREF="
     cwg_closed.html#643">643</A>,
<A HREF="
     cwg_defects.html#644">644</A>,
<A HREF="
     cwg_defects.html#645">645</A>,
<A HREF="
     cwg_closed.html#646">646</A>,
<A HREF="
     cwg_defects.html#647">647</A>,
<A HREF="
     cwg_defects.html#648">648</A>,
<A HREF="
     cwg_defects.html#649">649</A>,
<A HREF="
     cwg_defects.html#650">650</A>, and
<A HREF="
     cwg_defects.html#651">651</A>.
</LI>

<LI><B>Revision 49, 2007-08-05:</B> Reflected deliberations from the
Toronto (July, 2007) meeting.  Added additional discussion to issues
<A HREF="
     cwg_closed.html#219">219</A> and <A HREF="
     cwg_defects.html#339">339</A>.
Added new issues
<A HREF="
     cwg_defects.html#637">637</A>,
<A HREF="
     cwg_defects.html#638">638</A>,
<A HREF="
     cwg_defects.html#639">639</A>,
<A HREF="
     cwg_active.html#640">640</A>, and
<A HREF="
     cwg_defects.html#641">641</A>.
</LI>

<LI><B>Revision 48, 2007-06-24:</B> Added new issues
<A HREF="
     cwg_defects.html#632">632</A>,
<A HREF="
     cwg_defects.html#633">633</A>,
<A HREF="
     cwg_defects.html#634">634</A>,
<A HREF="
     cwg_closed.html#635">635</A>, and
<A HREF="
     cwg_active.html#636">636</A>.
</LI>

<LI><B>Revision 47, 2007-05-06:</B> Reflected deliberations from the
Oxford (April, 2007) meeting.
Added new issues
<A HREF="
     cwg_defects.html#626">626</A>,
<A HREF="
     cwg_closed.html#627">627</A>,
<A HREF="
     cwg_defects.html#628">628</A>,
<A HREF="
     cwg_defects.html#629">629</A>,
<A HREF="
     cwg_defects.html#630">630</A>, and
<A HREF="
     cwg_defects.html#631">631</A>.
</LI>

<LI><B>Revision 46, 2007-03-11:</B> Added proposed wording to
<A HREF="
     cwg_defects.html#495">issue 495</A> and moved it to
&#8220;review&#8221; status.  Added new issues
<A HREF="
     cwg_defects.html#612">612</A>,
<A HREF="
     cwg_defects.html#613">613</A>,
<A HREF="
     cwg_defects.html#614">614</A>,
<A HREF="
     cwg_defects.html#615">615</A>,
<A HREF="
     cwg_defects.html#616">616</A>,
<A HREF="
     cwg_active.html#617">617</A>,
<A HREF="
     cwg_defects.html#618">618</A>,
<A HREF="
     cwg_defects.html#619">619</A>,
<A HREF="
     cwg_defects.html#620">620</A>,
<A HREF="
     cwg_defects.html#621">621</A>,
<A HREF="
     cwg_closed.html#622">622</A>,
<A HREF="
     cwg_defects.html#623">623</A>,
<A HREF="
     cwg_defects.html#624">624</A>, and
<A HREF="
     cwg_defects.html#625">625</A>.
</LI>

<LI><B>Revision 45, 2007-01-14:</B> Changed the status of
<A HREF="
     cwg_defects.html#78">issue 78</A> from TC1 to WP.
Added new issues
<A HREF="
     cwg_defects.html#603">603</A>,
<A HREF="
     cwg_defects.html#604">604</A>,
<A HREF="
     cwg_defects.html#605">605</A>,
<A HREF="
     cwg_defects.html#606">606</A>,
<A HREF="
     cwg_active.html#607">607</A>,
<A HREF="
     cwg_defects.html#608">608</A>,
<A HREF="
     cwg_defects.html#609">609</A>,
<A HREF="
     cwg_closed.html#610">610</A>, and
<A HREF="
     cwg_defects.html#611">611</A>.
</LI>

<LI><B>Revision 44, 2006-11-05:</B> Reflected deliberations from the
Portland (October, 2006) meeting.  Added proposed wording for issues
<A HREF="
     cwg_defects.html#288">288</A>,
<A HREF="
     cwg_defects.html#342">342</A>, and
<A HREF="
     cwg_defects.html#572">572</A>, and moved them to &#8220;review&#8221;
status.  Added new issues
<A HREF="
     cwg_active.html#596">596</A>,
<A HREF="
     cwg_defects.html#597">597</A>,
<A HREF="
     cwg_defects.html#598">598</A>,
<A HREF="
     cwg_defects.html#599">599</A>,
<A HREF="
     cwg_active.html#600">600</A>,
<A HREF="
     cwg_defects.html#601">601</A>, and
<A HREF="
     cwg_defects.html#602">602</A>.
</LI>

<LI><B>Revision 43, 2006-09-09:</B> Updated issues
<A HREF="
     cwg_defects.html#218">218</A>,
<A HREF="
     cwg_defects.html#357">357</A>, and
<A HREF="
     cwg_defects.html#537">537</A> with additional discussion and proposed
resolutions and moved them to &#8220;review&#8221; status; added issues
<A HREF="
     cwg_defects.html#589">589</A>,
<A HREF="
     cwg_defects.html#590">590</A>,
<A HREF="
     cwg_defects.html#591">591</A>,
<A HREF="
     cwg_defects.html#592">592</A>,
<A HREF="
     cwg_closed.html#593">593</A>,
<A HREF="
     cwg_defects.html#594">594</A>, and
<A HREF="
     cwg_closed.html#595">595</A>.
</LI>

<LI><B>Revision 42, 2006-06-23:</B> Updated issues
<A HREF="
     cwg_defects.html#408">408</A> and <A HREF="
     cwg_defects.html#561">561</A> with
additional discussion; added a reference to a paper on the topic to
<A HREF="
     cwg_closed.html#567">issue 567</A>; and added issues
<A HREF="
     cwg_active.html#578">578</A>,
<A HREF="
     cwg_active.html#579">579</A>,
<A HREF="
     cwg_defects.html#580">580</A>,
<A HREF="
     cwg_active.html#581">581</A>,
<A HREF="
     cwg_defects.html#582">582</A>,
<A HREF="
     cwg_defects.html#583">583</A>,
<A HREF="
     cwg_closed.html#584">584</A>,
<A HREF="
     cwg_closed.html#585">585</A>,
<A HREF="
     cwg_closed.html#586">586</A>,
<A HREF="
     cwg_defects.html#587">587</A>, and
<A HREF="
     cwg_defects.html#588">588</A>.
</LI>

<LI><B>Revision 41, 2006-04-22:</B> Reflected deliberations from the
Berlin (April, 2006) meeting.  Added issues
<A HREF="
     cwg_active.html#562">562</A>,
<A HREF="
     cwg_active.html#563">563</A>,
<A HREF="
     cwg_defects.html#564">564</A>,
<A HREF="
     cwg_defects.html#565">565</A>,
<A HREF="
     cwg_closed.html#566">566</A>,
<A HREF="
     cwg_closed.html#567">567</A>,
<A HREF="
     cwg_defects.html#568">568</A>,
<A HREF="
     cwg_defects.html#569">569</A>,
<A HREF="
     cwg_defects.html#570">570</A>,
<A HREF="
     cwg_defects.html#571">571</A>,
<A HREF="
     cwg_defects.html#572">572</A>,
<A HREF="
     cwg_defects.html#573">573</A>,
<A HREF="
     cwg_closed.html#574">574</A>,
<A HREF="
     cwg_defects.html#575">575</A>,
<A HREF="
     cwg_defects.html#576">576</A>, and
<A HREF="
     cwg_defects.html#577">577</A>.
</LI>

<LI><B>Revision 40, 2006-02-24:</B> Updated
<A HREF="
     cwg_defects.html#540">issue 540</A> to refer to paper
J16/06-0022 = WG21 N1952 for its resolution.  Updated
<A HREF="
     cwg_active.html#453">issue 453</A> to note the need for additional
drafting.  Reopened <A HREF="
     cwg_active.html#504">issue 504</A> and broadened
its scope to include object declarations as well.  Updated
<A HREF="
     cwg_active.html#150">issue 150</A> (in &#8220;extension&#8221; status)
with additional commentary.
Added issues
<A HREF="
     cwg_closed.html#552">552</A>,
<A HREF="
     cwg_closed.html#553">553</A>,
<A HREF="
     cwg_active.html#554">554</A>,
<A HREF="
     cwg_active.html#555">555</A>,
<A HREF="
     cwg_defects.html#556">556</A>,
<A HREF="
     cwg_defects.html#557">557</A>,
<A HREF="
     cwg_defects.html#558">558</A>,
<A HREF="
     cwg_defects.html#559">559</A>,
<A HREF="
     cwg_active.html#560">560</A>, and
<A HREF="
     cwg_defects.html#561">561</A>.
</LI>

<LI><B>Revision 39, 2005-12-16:</B> Updated
<A HREF="
     cwg_defects.html#488">issue 488</A> with additional discussion.
Added issues
<A HREF="
     cwg_defects.html#538">538</A>,
<A HREF="
     cwg_defects.html#539">539</A>,
<A HREF="
     cwg_defects.html#540">540</A>,
<A HREF="
     cwg_defects.html#541">541</A>,
<A HREF="
     cwg_defects.html#542">542</A>,
<A HREF="
     cwg_defects.html#543">543</A>,
<A HREF="
     cwg_closed.html#544">544</A>,
<A HREF="
     cwg_active.html#545">545</A>,
<A HREF="
     cwg_defects.html#546">546</A>,
<A HREF="
     cwg_defects.html#547">547</A>,
<A HREF="
     cwg_closed.html#548">548</A>,
<A HREF="
     cwg_active.html#549">549</A>,
<A HREF="
     cwg_closed.html#550">550</A>, and
<A HREF="
     cwg_defects.html#551">551</A>.
</LI>

<LI><B>Revision 38, 2005-10-22:</B> Reflected deliberations from the
Mont Tremblant (October, 2005) meeting.  Added isues
<A HREF="
     cwg_defects.html#530">530</A>,
<A HREF="
     cwg_defects.html#531">531</A>,
<A HREF="
     cwg_defects.html#532">532</A>,
<A HREF="
     cwg_closed.html#533">533</A>,
<A HREF="
     cwg_defects.html#534">534</A>,
<A HREF="
     cwg_defects.html#535">535</A>,
<A HREF="
     cwg_active.html#536">536</A>, and
<A HREF="
     cwg_defects.html#537">537</A>.
</LI>

<LI><B>Revision 37, 2005-08-27:</B> Added issues
<A HREF="
     cwg_active.html#523">523</A>,
<A HREF="
     cwg_defects.html#524">524</A>,
<A HREF="
     cwg_defects.html#525">525</A>,
<A HREF="
     cwg_defects.html#526">526</A>,
<A HREF="
     cwg_defects.html#527">527</A>,
<A HREF="
     cwg_active.html#528">528</A>, and
<A HREF="
     cwg_active.html#529">529</A>.
</LI>

<LI><B>Revision 36, 2005-06-27:</B> Reopened <A HREF="
     cwg_defects.html#484">issue 484</A> for additional discussion.
Added issues
<A HREF="
     cwg_defects.html#517">517</A>,
<A HREF="
     cwg_defects.html#518">518</A>,
<A HREF="
     cwg_defects.html#519">519</A>,
<A HREF="
     cwg_defects.html#520">520</A>,
<A HREF="
     cwg_defects.html#521">521</A>, and
<A HREF="
     cwg_defects.html#522">522</A>.
</LI>

<LI><B>Revision 35, 2005-05-01:</B> Reflected deliberations from
the Lillehammer (April, 2005) meeting.  Updated issues
<A HREF="
     cwg_active.html#189">189</A> and <A HREF="
     cwg_active.html#459">459</A> with additional
discussion.  Added new issues
<A HREF="
     cwg_active.html#504">504</A>,
<A HREF="
     cwg_defects.html#505">505</A>,
<A HREF="
     cwg_defects.html#506">506</A>,
<A HREF="
     cwg_closed.html#507">507</A>,
<A HREF="
     cwg_defects.html#508">508</A>,
<A HREF="
     cwg_defects.html#509">509</A>,
<A HREF="
     cwg_defects.html#510">510</A>,
<A HREF="
     cwg_active.html#511">511</A>,
<A HREF="
     cwg_closed.html#512">512</A>,
<A HREF="
     cwg_defects.html#513">513</A>,
<A HREF="
     cwg_defects.html#514">514</A>,
<A HREF="
     cwg_defects.html#515">515</A>, and
<A HREF="
     cwg_defects.html#516">516</A>.
</LI>

<LI><B>Revision 34: 2005-03-06:</B> Closed <A HREF="
     cwg_closed.html#471">issue 471</A> as NAD; updated issues
<A HREF="
     cwg_defects.html#58">58</A>,
<A HREF="
     cwg_active.html#232">232</A>,
<A HREF="
     cwg_defects.html#339">339</A>,
<A HREF="
     cwg_defects.html#407">407</A>, and
<A HREF="
     cwg_defects.html#494">494</A>
with additional discussion; and added new issues
<A HREF="
     cwg_active.html#498">498</A>,
<A HREF="
     cwg_defects.html#499">499</A>,
<A HREF="
     cwg_defects.html#500">500</A>,
<A HREF="
     cwg_closed.html#501">501</A>,
<A HREF="
     cwg_defects.html#502">502</A>, and
<A HREF="
     cwg_active.html#503">503</A>.
</LI>

<LI><B>Revision 33: 2005-01-14:</B> Updated <A HREF="
     cwg_active.html#36">issue 36</A> with additional discussion.  Added new
issues
<A HREF="
     cwg_defects.html#485">485</A>,
<A HREF="
     cwg_defects.html#486">486</A>,
<A HREF="
     cwg_closed.html#487">487</A>,
<A HREF="
     cwg_defects.html#488">488</A>,
<A HREF="
     cwg_closed.html#489">489</A>,
<A HREF="
     cwg_defects.html#490">490</A>,
<A HREF="
     cwg_defects.html#491">491</A>,
<A HREF="
     cwg_defects.html#492">492</A>,
<A HREF="
     cwg_defects.html#493">493</A>,
<A HREF="
     cwg_defects.html#494">494</A>,
<A HREF="
     cwg_defects.html#495">495</A>,
<A HREF="
     cwg_defects.html#496">496</A>, and
<A HREF="
     cwg_defects.html#497">497</A>.
</LI>

<LI><B>Revision 32: 2004-11-07:</B> Reflected deliberations from
the Redmond (October, 2004) meeting.  Added new issues
<A HREF="
     cwg_defects.html#475">475</A>,
<A HREF="
     cwg_closed.html#476">476</A>,
<A HREF="
     cwg_defects.html#477">477</A>,
<A HREF="
     cwg_closed.html#478">478</A>,
<A HREF="
     cwg_defects.html#479">479</A>,
<A HREF="
     cwg_defects.html#480">480</A>,
<A HREF="
     cwg_defects.html#481">481</A>,
<A HREF="
     cwg_defects.html#482">482</A>,
<A HREF="
     cwg_defects.html#483">483</A>, and
<A HREF="
     cwg_defects.html#484">484</A>.
</LI>

<LI>
<B>Revision 31: 2004-09-10:</B> Updated <A HREF="
     cwg_active.html#268">issue 268</A> with comments from WG14; added comments and changed
the status of <A HREF="
     cwg_defects.html#451">issue 451</A> back to
&#8220;open&#8221;; added discussion to issues
<A HREF="
     cwg_closed.html#334">334</A>,
<A HREF="
     cwg_defects.html#341">341</A>,
<A HREF="
     cwg_defects.html#385">385</A>,
<A HREF="
     cwg_active.html#399">399</A>, and
<A HREF="
     cwg_defects.html#430">430</A>;
and added new issues
<A HREF="
     cwg_defects.html#470">470</A>,
<A HREF="
     cwg_closed.html#471">471</A>,
<A HREF="
     cwg_active.html#472">472</A>,
<A HREF="
     cwg_active.html#473">473</A>, and
<A HREF="
     cwg_defects.html#474">474</A>.
</LI>

<LI>
<B>Revision 30: 2004-04-09:</B> Reflected deliberations from the
Sydney (March, 2004) meeting.  Added issues 461-469, updated issues
<A HREF="
     cwg_defects.html#39">39</A>,
<A HREF="
     cwg_defects.html#86">86</A>,
<A HREF="
     cwg_defects.html#257">257</A>,
<A HREF="
     cwg_defects.html#291">291</A>,
<A HREF="
     cwg_defects.html#391">391</A>,
<A HREF="
     cwg_defects.html#389">389</A>,
<A HREF="
     cwg_closed.html#435">435</A>,
<A HREF="
     cwg_defects.html#436">436</A>,
<A HREF="
     cwg_defects.html#437">437</A>,
<A HREF="
     cwg_defects.html#439">439</A>,
<A HREF="
     cwg_defects.html#441">441</A>,
<A HREF="
     cwg_defects.html#442">442</A>,
<A HREF="
     cwg_defects.html#446">446</A>,
<A HREF="
     cwg_defects.html#450">450</A>,
<A HREF="
     cwg_active.html#453">453</A>,
and
<A HREF="
     cwg_defects.html#458">458</A>.
</LI>

<LI>
<B>Revision 29: 2004-02-13:</B> Added issues 441-460, updated issues
<A HREF="
     cwg_defects.html#39">39</A>,
<A HREF="
     cwg_defects.html#291">291</A>,
<A HREF="
     cwg_defects.html#306">306</A>,
<A HREF="
     cwg_defects.html#319">319</A>,
<A HREF="
     cwg_defects.html#389">389</A>,
<A HREF="
     cwg_defects.html#394">394</A>,
<A HREF="
     cwg_defects.html#413">413</A>,
and
<A HREF="
     cwg_defects.html#417">417</A>.
</LI>

<LI>
<B>Revision 28: 2003-11-15:</B> Reflected deliberations from the
Kona (October, 2003) meeting.  Added issues 435-438.
</LI>

<LI>
<B>Revision 27: 2003-09-19:</B> Added new issues 412-434, updated
<A HREF="
     cwg_defects.html#54">issues 54</A>,
<A HREF="
     cwg_defects.html#301">301</A>,
<A HREF="
     cwg_defects.html#372">372</A>,
<A HREF="
     cwg_defects.html#382">382</A>,
<A HREF="
     cwg_defects.html#391">391</A>, and
<A HREF="
     cwg_active.html#399">399</A>.
</LI>

<LI>
<B>Revision 26: 2003-04-25:</B>  Reflected deliberations from
the Oxford (April, 2003) meeting.  Added new issues 402-411.
</LI>

<LI>
<B>Revision 25: 2003-03-03:</B> Added new issues 390-401, updated
<A HREF="
     cwg_defects.html#214">issue 214</A>.
</LI>
<LI>
<B>Revision 24: 2002-11-08:</B> Reflected deliberations from the
Santa Cruz (October, 2002) meeting.  Added new issues 379-389.
</LI>

<LI>
<B>Revision 23: 2002-09-10:</B> Added new issues 355-378, updated
<A HREF="
     cwg_defects.html#298">issue 298</A> and <A HREF="
     cwg_defects.html#214">issue 214</A>.
</LI>
<LI>
<B>Revision 22: 2002-05-10:</B> Reflected deliberations from the
Curacao (April, 2002) meeting.  Added issues 342-354.
</LI>
<LI>
<B>Revision 21: 2002-03-11:</B> Added new issues 314-341, updated issues
<A HREF="
     cwg_closed.html#132">132</A>,
<A HREF="
     cwg_defects.html#214">214</A>,
<A HREF="
     cwg_defects.html#244">244</A>,
<A HREF="
     cwg_defects.html#245">245</A>,
<A HREF="
     cwg_defects.html#254">254</A>,
<A HREF="
     cwg_active.html#255">255</A>,
<A HREF="
     cwg_defects.html#283">283</A>.
</LI>

<LI>
<B>Revision 20: 2001-11-09:</B> Reflected deliberations from the
Redmond (October, 2001) meeting.  Added issue <A HREF="
     cwg_closed.html#313">313</A>.
</LI>

<LI>
<B>Revision 19: 2001-09-12:</B> Added new issues 289-308, updated
issues <A HREF="
     cwg_defects.html#222">222</A>, <A HREF="
     cwg_defects.html#261">261</A>,
<A HREF="
     cwg_defects.html#270">270</A>.
</LI>

<LI>
<B>Revision 18: 2001-05-19:</B> Reflected deliberations from the
Copenhagen (April, 2001) meeting.  Added new issues 282-288.
</LI>

<LI>
<B>Revision 17: 2001-04-29:</B> Added new issues 276-81.
</LI>

<LI>
<B>Revision 16: 2001-03-27:</B> Updated <A HREF="
     cwg_active.html#138">issue 138</A> to discuss the interaction of <I>using-declaration</I>s
and "forward declarations."  Noted a problem with the proposed
resolution of <A HREF="
     cwg_defects.html#139">issue 139</A>.  Added some
new discussion to  <A HREF="
     cwg_defects.html#115">issue 115</A>.  Added
proposed resolution for <A HREF="
     cwg_defects.html#160">issue 160</A>.  Updated
address of C++ FAQ.  Added new issues 265-275.
</LI>

<LI>
<B>Revision 15: 2000-11-18:</B> Reflected deliberations from the
Toronto (October, 2000) meeting; moved the discussion of empty and
fully-initialized const objects from <A HREF="
     cwg_defects.html#78">issue 78</A> into <A HREF="
     cwg_active.html#253">new issue 253</A>;
added new issues 254-264.
</LI>

<LI>
<B>Revision 14: 2000-10-21:</B> Added issues 246-252; added an extra
question to <A HREF="
     cwg_defects.html#221">issue 221</A> and changed its
status back to "review."
</LI>

<LI>
<B>Revision 13: 2000-09-16:</B> Added issues 229-245; changed status
of <A HREF="
     cwg_defects.html#106">issue 106</A> to "review" because of problem
detected in proposal; added wording for issues <A HREF="
     cwg_defects.html#87">87</A> and <A HREF="
     cwg_defects.html#216">216</A> and moved to "review"
status; updated discussion of issues
<A HREF="
     cwg_defects.html#5">5</A>,
<A HREF="
     cwg_defects.html#78">78</A>,
<A HREF="
     cwg_defects.html#198">198</A>,
<A HREF="
     cwg_closed.html#203">203</A>, and
<A HREF="
     cwg_defects.html#222">222</A>.
</LI>

<LI>
<B>Revision 12: 2000-05-21:</B> Reflected deliberations from the
Tokyo (April, 2000) meeting; added new issues 222-228.
</LI>

<LI>
<B>Revision 11, 2000-04-13:</B> Added proposed wording and moved
issues
<A HREF="
     cwg_defects.html#62">62</A>,
<A HREF="
     cwg_defects.html#73">73</A>,
<A HREF="
     cwg_defects.html#89">89</A>,
<A HREF="
     cwg_defects.html#94">94</A>,
<A HREF="
     cwg_defects.html#106">106</A>,
<A HREF="
     cwg_defects.html#121">121</A>,
<A HREF="
     cwg_defects.html#134">134</A>,
<A HREF="
     cwg_defects.html#142">142</A>, and
<A HREF="
     cwg_defects.html#145">145</A>
to "review" status.  Moved <A HREF="
     cwg_closed.html#13">issue 13</A>
from "extension" to "open" status because of recent additional
discussion.
Added new issues 217-221.
</LI>

<LI>
<B>Revision 10, 2000-03-21:</B> Split the issues list and indices into
multiple documents.  Added further discussion to issues
<A HREF="
     cwg_defects.html#84">84</A> and <A HREF="
     cwg_defects.html#87">87</A>.
Added proposed wording and moved issues
<A HREF="
     cwg_defects.html#1">1</A>,
<A HREF="
     cwg_defects.html#69">69</A>,
<A HREF="
     cwg_defects.html#85">85</A>,
<A HREF="
     cwg_defects.html#98">98</A>,
<A HREF="
     cwg_defects.html#105">105</A>,
<A HREF="
     cwg_defects.html#113">113</A>,
<A HREF="
     cwg_closed.html#132">132</A>, and
<A HREF="
     cwg_defects.html#178">178</A>
to "review" status.
Added new issues 207-216.
</LI>

<LI><B>Revision 9, 2000-02-23:</B> Incorporated decisions from the
October, 1999 meeting of the Committee;

added issues 174 through 206.</LI>

<LI><B>Revision 8, 1999-10-13:</B> Minor editorial changes to issues
<A HREF="
     cwg_defects.html#90">90</A> and
<A HREF="
     cwg_defects.html#24">24</A>; updated issue
<A HREF="
     cwg_defects.html#89">89</A> to include a related question;
added issues
<A HREF="
     cwg_closed.html#169">169</A>,
<A HREF="
     cwg_active.html#170">170</A>,
<A HREF="
     cwg_defects.html#171">171</A>,
<A HREF="
     cwg_defects.html#172">172</A>, and
<A HREF="
     cwg_defects.html#173">173</A>.</LI>

<LI><B>Revision 7, 1999-09-14:</B> Removed unneeded change to
14.7.3 [temp.expl.spec] paragraph 9 from
<A HREF="
     cwg_defects.html#24">issue 24</A>; changed
<A HREF="
     cwg_defects.html#85">issue 85</A> to refer to
3.4.4 [basic.lookup.elab];
added issues
<A HREF="
     cwg_defects.html#122">122</A>,
<A HREF="
     cwg_defects.html#123">123</A>,
<A HREF="
     cwg_defects.html#124">124</A>,
<A HREF="
     cwg_defects.html#125">125</A>,
<A HREF="
     cwg_defects.html#126">126</A>,
<A HREF="
     cwg_defects.html#127">127</A>,
<A HREF="
     cwg_defects.html#128">128</A>,
<A HREF="
     cwg_defects.html#129">129</A>,
<A HREF="
     cwg_closed.html#130">130</A>,
<A HREF="
     cwg_defects.html#131">131</A>,
<A HREF="
     cwg_closed.html#132">132</A>,
<A HREF="
     cwg_closed.html#133">133</A>,
<A HREF="
     cwg_defects.html#134">134</A>,
<A HREF="
     cwg_defects.html#135">135</A>,
<A HREF="
     cwg_defects.html#136">136</A>,
<A HREF="
     cwg_defects.html#137">137</A>,
<A HREF="
     cwg_active.html#138">138</A>,
<A HREF="
     cwg_defects.html#139">139</A>,
<A HREF="
     cwg_defects.html#140">140</A>,
<A HREF="
     cwg_defects.html#141">141</A>,
<A HREF="
     cwg_defects.html#142">142</A>,
<A HREF="
     cwg_defects.html#143">143</A>,
<A HREF="
     cwg_active.html#144">144</A>,
<A HREF="
     cwg_defects.html#145">145</A>,
<A HREF="
     cwg_active.html#146">146</A>,
<A HREF="
     cwg_defects.html#147">147</A>,
<A HREF="
     cwg_defects.html#148">148</A>,
<A HREF="
     cwg_defects.html#149">149</A>,
<A HREF="
     cwg_active.html#150">150</A>,
<A HREF="
     cwg_defects.html#151">151</A>,
<A HREF="
     cwg_defects.html#152">152</A>,
<A HREF="
     cwg_defects.html#153">153</A>,
<A HREF="
     cwg_closed.html#154">154</A>,
<A HREF="
     cwg_closed.html#155">155</A>,
<A HREF="
     cwg_active.html#156">156</A>,
<A HREF="
     cwg_active.html#157">157</A>,
<A HREF="
     cwg_defects.html#158">158</A>,
<A HREF="
     cwg_defects.html#159">159</A>,
<A HREF="
     cwg_defects.html#160">160</A>,
<A HREF="
     cwg_defects.html#161">161</A>,
<A HREF="
     cwg_defects.html#162">162</A>,
<A HREF="
     cwg_defects.html#163">163</A>,
<A HREF="
     cwg_defects.html#164">164</A>,
<A HREF="
     cwg_closed.html#165">165</A>,
<A HREF="
     cwg_defects.html#166">166</A>,
<A HREF="
     cwg_closed.html#167">167</A>, and
<A HREF="
     cwg_closed.html#168">168</A>.</LI>

<LI><B>Revision 6, 1999-05-31:</B> Moved
<A HREF="
     cwg_closed.html#72">issue 72</A> to "dup" status; added
proposed wording and moved <A HREF="
     cwg_defects.html#90">issue 90</A>
to "review" status; updated <A HREF="
     cwg_defects.html#98">issue 98</A>
with additional question; added issues
<A HREF="
     cwg_active.html#110">110</A>,
<A HREF="
     cwg_closed.html#111">111</A>,
<A HREF="
     cwg_defects.html#112">112</A>,
<A HREF="
     cwg_defects.html#113">113</A>,
<A HREF="
     cwg_closed.html#114">114</A>,
<A HREF="
     cwg_defects.html#115">115</A>,
<A HREF="
     cwg_defects.html#116">116</A>,
<A HREF="
     cwg_closed.html#117">117</A>,
<A HREF="
     cwg_defects.html#118">118</A>,
<A HREF="
     cwg_defects.html#119">119</A>,
<A HREF="
     cwg_defects.html#120">120</A>, and
<A HREF="
     cwg_defects.html#121">121</A>.</LI>

<LI><B>Revision 5, 1999-05-24:</B> Reordered issues by status; added revision
history; first public version.</LI>
</UL>

<A NAME="Issue Status"></A>
<H3>Issue status</H3>

<P>Issues progress through various statuses as the Core Language
Working Group and, ultimately, the full PL22.16 and WG21 committees
deliberate and act.  For ease of reference, issues are grouped in these
documents by their status.  Issues have one of the following statuses:</P>

<P><B>Open:</B> The issue is new or the working group has not yet
formed an opinion on the issue.  If a <I>Suggested Resolution</I> is
given, it reflects the opinion of the issue's submitter, not
necessarily that of the working group or the Committee as a whole.</P>

<P><B>Drafting:</B> Informal consensus has been reached in the
working group and is described in rough terms in a <I>Tentative
Resolution</I>, although precise wording for the change is not yet
available.</P>

<P><B>Review:</B> Exact wording of a <I>Proposed Resolution</I> is now
available for an issue on which the working group previously reached
informal consensus.</P>

<P><B>Ready:</B> The working group has reached consensus that a change
in the working draft is required, the <I>Proposed Resolution</I> is
correct, and the issue is ready to forward to the full Committee for
ratification.</P>

<P><B>Tentatively Ready:</B> Like "ready" except that the resolution
was produced and approved by a subset of the working group membership
between meetings.  Persons not participating in these between-meeting
activities are encouraged to review such resolutions carefully and to
alert the working group with any problems that may be found.</P>

<P><B>DR:</B> The full Committee has approved the item as a proposed
defect report.  The <I>Proposed Resolution</I> in an issue with this
status reflects the best judgment of the Committee at this time
regarding the action that will be taken to remedy the defect; however,
the current wording of the Standard remains in effect until such time
as a <I>Technical Corrigendum</I> or a revision of the Standard is
issued by ISO.</P>

<P><B>Accepted:</B> Like a DR except that the issue concerns the
wording of the current Working Paper rather than that of the current
International Standard.</P>

<P><B>TC1:</B> A DR issue included in Technical Corrigendum 1.
TC1 is a revision of the Standard issued in 2003.</P>

<P><B>CD1:</B> A DR issue not resolved in TC1 but included in
Committee Draft 1.  CD1 was advanced for balloting at the
September, 2008 WG21 meeting.</P>

<P><B>CD2:</B> A DR issue not resolved in CD1 but included in
the Final Committee Draft advanced for balloting at the
March, 2010 WG21 meeting.</P>

<P><B>C++11:</B> A DR issue not resolved in CD2 but included
in ISO/IEC 14882:2011.</P>

<P><B>CD3:</B> A DR/DRWP or Accepted/WP issue not resolved
in C++11 but included in the Committee Draft advanceed for
balloting at the April, 2013 WG21 meeting.</P>

<P><B>C++14:</B> A DR/DRWP or Accepted/WP issue not resolved
in CD3 but included in ISO/IEC 14882:2014.</P>

<P><B>DRWP:</B> A DR issue whose resolution is reflected in
the current Working Paper.  The Working Paper is a draft for a
future version of the Standard.</P>

<P><B>WP:</B> An Accepted issue whose resolution is reflected in
the current Working Paper.</P>

<P><B>Dup:</B> The issue is identical to or a subset of another issue,
identified in a <I>Rationale</I> statement.</P>

<P><B>NAD:</B> The working group has reached consensus that the issue
is not a defect in the Standard. A <I>Rationale</I> statement
describes the working group's reasoning.</P>

<P><B>Extension:</B> The working group has reached consensus that the
issue is not a defect in the Standard but is a request for an
extension to the language.  The working group
expresses no opinion on the merits of an issue with this status;
however, the issue will be maintained on the list for possible future
consideration as an extension proposal.</P>

<P><B>Concepts:</B> The issue relates to the &#8220;Concepts&#8221;
proposal that was removed from the working paper at the Frankfurt (July,
2009) meeting and hence is no longer under consideration.
</P>

<P><B>Concurrency:</B> The issue deals with concurrency and
is to be handled by the Concurrency and Parallelism Study
Group (SG1) within WG21.</P>
<HR><A NAME="Ready Status"></A><H3>Issues with "Ready" Status</H3>
<HR><A NAME="1875"></A><H4>1875.
  
Reordering declarations in class scope
</H4><B>Section: </B>3.3.7&#160; [basic.scope.class]
 &#160;&#160;&#160;

 <B>Status: </B>ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-19<BR>




<P>The rules for class scope in 3.3.7 [basic.scope.class] paragraph
1 include the following:</P>

<OL START="2"><LI><P>A name <TT>N</TT> used in a class <TT>S</TT> shall
refer to the same declaration in its context and when re-evaluated in the
completed scope of <TT>S</TT>. No diagnostic is required for a violation of
this rule.</P></LI>

<LI><P>If reordering member declarations in a class yields an alternate valid
program under (1) and (2), the program is ill-formed, no diagnostic is
required.</P></LI>

</OL>

<P>The need for rule #3 is not clear; it would seem that any
otherwise-valid reordering would have to violate rule #2 in order to yield
a different interpretation. Taken literally, rule #3 would also apply to
simply reordering nonstatic data members with no name dependencies at
all.  Can it be simply removed?</P>

<P><B>Proposed resolution (June, 2014):</B></P>

<P>Delete the third item of 3.3.7 [basic.scope.class] paragraph 1 and
renumber the succeeding items:</P>

<OL START="3"><LI><P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">If reordering member declarations in a
class yields an alternate valid program under (1) and (2), the
program is ill-formed, no diagnostic is
required.</SPAN></P></LI></OL>

<BR><BR><HR><A NAME="1986"></A><H4>1986.
  
odr-use and delayed initialization
</H4><B>Section: </B>3.6.2&#160; [basic.start.init]
 &#160;&#160;&#160;

 <B>Status: </B>ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-21<BR>




<P>The current wording of 3.6.2 [basic.start.init] allows deferral
of static and thread_local initialization until a variable or function
in the containing translation unit is odr-used.  This requires
implementations to avoid optimizing away the relevant odr-uses.  We
should consider relaxing the rule to allow for such optimizations.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<BLOCKQUOTE>

For a variable <TT>V</TT> with thread or static storage duration,
let <TT>X</TT> be the set of all variables with the same storage duration
as <TT>V</TT> that are defined in the same translation unit
as <TT>V</TT>. If the observable behavior of the abstract machine
(1.8 [intro.object]) depends on the value of <TT>V</TT> through an
evaluation <I>E</I>, and <I>E</I> is not sequenced before the end of the
initialization of any variable in <TT>X</TT>, then the end of the
initialization of all variables in <TT>X</TT> is sequenced before <I>E</I>.

</BLOCKQUOTE>

<P>There is also a problem (submitted by David Majnemer) if the odr-use
occurs in a constexpr context that does not require the variable to be
constructed.  For example,</P>

<PRE>
  struct A { A(); };
  thread_local A a;

  constexpr bool f() { return &amp;a != nullptr; }
</PRE>

<P>It doesn't seem possible to construct <TT>a</TT> before its
odr-use in <TT>f</TT>.</P>

<P>There is implementation divergence in the handling of this example.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG determined that the second part of the issue (involving
<TT>constexpr</TT>) is not a defect because the address of an
object with thread storage duration is not a constant
expression.</P>

<BR><BR><HR><A NAME="1652"></A><H4>1652.
  
Object addresses in <TT>constexpr</TT> expressions
</H4><B>Section: </B>5.10&#160; [expr.eq]
 &#160;&#160;&#160;

 <B>Status: </B>ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-15<BR>


<P>Pointer equality is defined by reference to the addresses of the
objects designated by the pointer values, reflecting the implementation
technique of most/all compilers.  However, this definition is intrinsically
a runtime property, and such a description is inappropriate with respect to
<TT>constexpr</TT> expressions, which must deal with pointer comparisons
without necessarily knowing the runtime layout of the objects involved.  A
better definition usable at compile time is needed.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 5.10 [expr.eq] paragraph 2, converting
the existing running text into bullets, as follows:</P>

<BLOCKQUOTE>

<P>If at least one of the operands is a pointer, pointer
conversions (4.10 [conv.ptr]) and qualification
conversions (4.4 [conv.qual]) are performed on both
operands to bring them to their composite pointer type
(Clause 5 [expr]). Comparing pointers is
defined as follows: <SPAN style="text-decoration:line-through;background-color:#FFA0A0">Two pointers compare equal</SPAN></P>

<UL><LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">If one pointer represents the address of a
complete object, and another pointer represents the address
one past the last element of a different complete object
[<I>Footnote:</I> An object that is not an array element is
considered to belong to a single-element array for this
purpose; see 5.3.1 [expr.unary.op]. &#8212;<I>end
footnote</I>], the result of the comparison is
unspecified.</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">Otherwise,</SPAN> if <SPAN style="text-decoration:line-through;background-color:#FFA0A0">they</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">the
pointers</SPAN> are both null, both point to the same function,
or both represent the same address (3.9.2 [basic.compound],
<SPAN style="font-weight:bold;background-color:#A0FFA0">they compare equal.</SPAN></P></LI>

<LI><P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">otherwise they</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">Otherwise, the
pointers</SPAN> compare unequal.</P></LI>

</UL>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1873"></A><H4>1873.
  
Protected member access from derived class friends
</H4><B>Section: </B>11.2&#160; [class.access.base]
 &#160;&#160;&#160;

 <B>Status: </B>ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-18<BR>




<P>According to 11.2 [class.access.base] paragraph 5,</P>

<BLOCKQUOTE>

<P>A member <TT>m</TT> is accessible at the point <I>R</I> when named in
class <TT>N</TT> if</P>

<UL><LI><P>...</P></LI>

<LI><P><TT>m</TT> as a member of <TT>N</TT> is protected, and <I>R</I> occurs in a member or friend of
class <TT>N</TT>, or in a member or friend of a class <TT>P</TT> derived from <TT>N</TT>, where <TT>m</TT> as a
member of <TT>P</TT> is public, private, or protected, or</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>The granting of access via class <TT>P</TT> is troubling.  At the
least, there should be a restriction that <TT>P</TT> be visible at
<I>R</I>.  Alternatively, this portion of the rule could be removed
altogether; this provision does not appear to be widely used in
existing code and such references can be easily converted to use
<TT>P</TT> instead of <TT>N</TT> for naming the member.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG noted that removing the <TT>friend</TT> provision would
introduce an undesirable asymmetry between member functions
of <TT>P</TT> and its friends. Instead, the intent is to require
<TT>P</TT> to be a complete type at <I>R</I>.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>Although the asymmetry is unfortunate, the difference
between a reference in a member function and a reference in
a friend is that the member function concretely determines
which <TT>P</TT> is in view, while the friend could be
befriended by a class that is a specialization of a class
template and thus would require instantiations that would
not otherwise occur.  CWG thus decided simply to eliminate
the friend case.</P>

<P><B>Proposed resolution, November, 2014:</B></P>

<P>Change bullet 5.3 of 11.2 [class.access.base] as follows:</P>

<BLOCKQUOTE>

<P>...A member <TT>m</TT> is accessible at the
point <I>R</I> when named in class <TT>N</TT> if</P>

<UL><LI><P>...</P></LI>

<LI><P><TT>m</TT> as a member of <TT>N</TT> is protected,
and <I>R</I> occurs in a member or friend of
class <TT>N</TT>, or in a member <SPAN style="text-decoration:line-through;background-color:#FFA0A0">or friend</SPAN> of a
class <TT>P</TT> derived from <TT>N</TT>, where <TT>m</TT>
as a member of <TT>P</TT> is public, private, or protected,
or</P></LI>

<LI><P>there exists...</P></LI>

</UL>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1309"></A><H4>1309.
  
Incorrect note regarding lookup of a member of the current instantiation
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-05-05<BR>




<P>The note in 14.6.2.1 [temp.dep.type] paragraph 7 reads,</P>

<BLOCKQUOTE>

[<I>Note:</I> the result of name lookup differs only when the member
of the current instantiation was found in a non-dependent base class
of the current instantiation and a member with the same name is also
introduced by the substitution for a dependent base class of the
current instantiation.  &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>However, this is not correct.  Consider the following example:</P>

<PRE>
  struct Y { int X; };

  template&lt;typename T&gt;
  struct A : Y {
   enum B : int;
   void f() { A::X; } //<SPAN style="font-family:Times;font-style:italic"> finds </SPAN>Y::X<SPAN style="font-family:Times;font-style:italic"> here!</SPAN>
  };

  template&lt;typename T&gt;
  enum A&lt;T&gt;::B : int {
   X //<SPAN style="font-family:Times;font-style:italic"> introduces member </SPAN>A::X<SPAN style="font-family:Times;font-style:italic"> into </SPAN>A&lt;T&gt;<SPAN style="font-family:Times;font-style:italic">!</SPAN>
  };

  void g() { A&lt;int&gt; a; a.f(); }
</PRE>

<P><TT>A::X</TT> is a member of the current instantiation, so
paragraph 7 requires it to be looked up again when instantiating and
to give a diagnostic if the lookup differs from the lookup in the
definition context. The note incorrectly indicates that this can only
happen if the conflicting name was introduced by a dependent base
class.</P>

<P><B>Proposed resolution (August, 2011) [SUPERSEDED]:</B></P>

<P>Change 14.6.2.1 [temp.dep.type] paragraph 7 as follows:</P>

<BLOCKQUOTE>

<P>...If the result of this lookup differs from the result of name
lookup in the template definition context, name lookup is
ambiguous. <SPAN style="text-decoration:line-through;background-color:#FFA0A0">[<I>Note:</I> the result of name lookup differs only
when the member of the current instantiation was found in a
non-dependent base class of the current instantiation and a member
with the same name is also introduced by the substitution for a
dependent base class of the current instantiation. &#8212;<I>end
note</I>]</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">  struct A {
    int m;
  };

  struct B {
    int m;
  };

  template&lt;typename T&gt;
  struct C : A, T {
    int f() { return this-&gt;m; } //<SPAN style="font-family:Times;font-style:italic"> finds </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> in the template definition context</SPAN>
  };

  int g(C&lt;B&gt; cb) {
    return cb.f();              //<SPAN style="font-family:Times;font-style:italic"> error: finds both </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> and </SPAN>B::m<SPAN style="font-family:Times;font-style:italic"> in the template instantiation context</SPAN>
  }</SPAN>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE>

<P><B>Notes from the December, 2011 teleconference:</B></P>

<P>Changes to the exposition were suggested and the issue returned to
"drafting" status.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 14.6.2.1 [temp.dep.type] paragraph 7 as follows:

<BLOCKQUOTE>

<P>...If the result of this lookup differs from the result
of name lookup in the template definition context, name
lookup is ambiguous.  <SPAN style="text-decoration:line-through;background-color:#FFA0A0">[<I>Note:</I> the result of name
lookup differs only when the member of the current
instantiation was found in a non-dependent base class of the
current instantiation and a member with the same name is
also introduced by the substitution for a dependent base
class of the current instantiation. &#8212;<I>end
note</I>]</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">  struct A {
    int m;
  };

  struct B {
    int m;
  };

  template&lt;typename T&gt;
  struct C : A, T {
    int f() { return this-&gt;m; }  //<SPAN style="font-family:Times;font-style:italic"> finds </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> in the template definition context</SPAN>
  };

  template int C&lt;B&gt;::f();        //<SPAN style="font-family:Times;font-style:italic"> error: finds both </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> and </SPAN>B::m</SPAN>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE></P>

<BR><BR><BR><BR><HR><A NAME="Tentatively Ready Status"></A><H3>Issues with "Tentatively Ready" Status</H3>
<HR><A NAME="1999"></A><H4>1999.
  
Representation of source characters as universal-character-names
</H4><B>Section: </B>2.2&#160; [lex.phases]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-09<BR>




<P>According to 2.2 [lex.phases] paragraph 1, first phase,</P>

<BLOCKQUOTE>

Any source file character not in the basic source character
set (2.3 [lex.charset]) is replaced by the
universal-character-name that designates that character. (An
implementation may use any internal encoding, so long as an
actual extended character encountered in the source file,
and the same extended character expressed in the source file
as a universal-character-name (i.e., using
the <TT>\uXXXX</TT> notation), are handled equivalently
except where this replacement is reverted in a raw string
literal.)

</BLOCKQUOTE>

<P>This wording is obviously not intended to exclude the use of
characters with code points larger than <TT>0xffff</TT>, but
the reference to &#8220;the <TT>\uXXXX</TT> notation&#8221; might
suggest that the <TT>\Uxxxxxxxx</TT> form is not allowed.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 2.2 [lex.phases] paragraph 1 number 1 as follows:</P>

<BLOCKQUOTE>

...(An implementation may use any internal encoding, so long as
an actual extended character encountered in the source file, and
the same extended character expressed in the source file as a
universal-character-name (<SPAN style="text-decoration:line-through;background-color:#FFA0A0">i.e.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">e.g.</SPAN>, using
the <TT>\uXXXX</TT> notation), are handled equivalently except
where this replacement is reverted in a raw string literal.)

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1963"></A><H4>1963.
  
Implementation-defined identifier characters
</H4><B>Section: </B>2.10&#160; [lex.name]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-07<BR>




<P>The grammar in 2.10 [lex.name] includes the production,</P>

<UL><I>identifier-nondigit:</I>
<UL><I>nondigit</I><BR>
<I>universal-character-name</I><BR>
<I>other implementation-defined characters</I>
</UL>
</UL>

<P>The rule for &#8220;other implementation-defined
characters&#8221; is a holdover from before the introduction of
universal-character-names, intended to allow the use of non-ASCII
national characters in identifiers.  However, since all
characters outside the basic source character set are now
conceptually mapped to universal-character-names in translation
phase 1, there is no longer a need for such a provision and it
should be removed.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change the grammar in 2.10 [lex.name] as follows:</P>

<UL><I>identifier-nondigit:</I>
<UL><I>nondigit</I><BR>
<I>universal-character-name</I><BR>
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">other implementation-defined-characters</SPAN>
</UL>
</UL>

<BR><BR><HR><A NAME="1926"></A><H4>1926.
  
Potential results of subscript operator
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Marcel Wid
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-13<BR>


<P>The definition of the potential results of an expression in
3.2 [basic.def.odr] paragraph 2 do not, but should, include the
subscript operator.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 3.2 [basic.def.odr] paragraph 2 as follows:</P>

<BLOCKQUOTE>

<P>...The set of <I>potential results</I> of an
expression <TT>e</TT> is defined as follows:</P>

<UL><LI><P>If <TT>e</TT> is an <I>id-expression</I>
(5.1.1 [expr.prim.general]), the set contains only <TT>e</TT>.</P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">If <TT>e</TT> is a subscripting operation
(5.2.1 [expr.sub]) with an array operand, the set
contains that operand.</SPAN></P></LI>

<LI><P>If <TT>e</TT> is a class member access...</P></LI>

</UL>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1886"></A><H4>1886.
  
Language linkage for <TT>main()</TT>
</H4><B>Section: </B>3.6.1&#160; [basic.start.main]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-04<BR>




<P>There does not appear to be any restriction on giving
<TT>main()</TT> an explicit language linkage, but it should
probably be either ill-formed or conditionally-supported.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 3.6.1 [basic.start.main] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

An implementation shall not predefine the <TT>main</TT>
function. This function shall not be overloaded. <SPAN style="text-decoration:line-through;background-color:#FFA0A0">It</SPAN> 
<SPAN style="font-weight:bold;background-color:#A0FFA0">Its type shall have C++ language linkage and it</SPAN> shall
have a declared return type of type <TT>int</TT>, but
otherwise its type is implementation-defined. An
implementation shall allow both...

</BLOCKQUOTE>

<LI><P>Change 3.6.1 [basic.start.main] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

The function <TT>main</TT> shall not be used within a
program. The linkage (3.5 [basic.link])
of <TT>main</TT> is implementation-defined.  A program that
defines <TT>main</TT> as deleted or that
declares <TT>main</TT> to be <TT>inline</TT>, <TT>static</TT>, or
<TT>constexpr</TT> is ill-formed. <SPAN style="font-weight:bold;background-color:#A0FFA0">The <TT>main</TT> function
shall not be declared with a <I>linkage-specification</I>
(7.5 [dcl.link]).  A program that declares a variable
<TT>main</TT> at global scope or that declares the name
<TT>main</TT> with C language linkage (in any namespace) is
ill-formed.</SPAN> The name <TT>main</TT> is not otherwise
reserved...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1956"></A><H4>1956.
  
Reuse of storage of automatic variables
</H4><B>Section: </B>3.7.3&#160; [basic.stc.auto]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-29<BR>




<P>According to 3.7.3 [basic.stc.auto] paragraph 3,</P>

<BLOCKQUOTE>

If a variable with automatic storage duration has
initialization or a destructor with side effects, it shall
not be destroyed before the end of its block, nor shall it
be eliminated as an optimization even if it appears to be
unused, except that a class object or its copy/move may be
eliminated as specified in 12.8 [class.copy].

</BLOCKQUOTE>

<P>This is intended to be a requirement for the implementation,
but it could be read as prohibiting the reuse of the storage of
an automatic variable by the program using a placement
<I>new-expression</I>.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 3.7.3 [basic.stc.auto] paragraph 3 as follows:</P>

<BLOCKQUOTE>

If a variable with automatic storage duration has
initialization or a destructor with side
effects, <SPAN style="text-decoration:line-through;background-color:#FFA0A0">it</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">an implementation</SPAN> shall
not <SPAN style="text-decoration:line-through;background-color:#FFA0A0">be destroyed</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">destroy it</SPAN> before the
end of its block<SPAN style="text-decoration:line-through;background-color:#FFA0A0">,</SPAN> nor <SPAN style="text-decoration:line-through;background-color:#FFA0A0">shall it be
eliminated</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">eliminate it</SPAN> as an
optimization<SPAN style="font-weight:bold;background-color:#A0FFA0">,</SPAN> even if it appears to be unused,
except that a class object or its copy/move may be
eliminated as specified in 12.8 [class.copy].

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1951"></A><H4>1951.
  
Cv-qualification and literal types
</H4><B>Section: </B>3.9&#160; [basic.types]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-19<BR>


<P>3.9 [basic.types] paragraph 10 isn't clear whether a
const-qualified class type can be a literal type, and the same for
<TT>const void</TT>.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 3.9 [basic.types] paragraph 10 as follows:</P>

<BLOCKQUOTE>

<P>A type is a <I>literal type</I> if it is:</P>

<UL><LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">possibly cv-qualified</SPAN> <TT>void</TT>; or</P></LI>

<LI><P>a scalar type; or</P></LI>

<LI><P>a reference type; or</P></LI>

<LI><P>an array of literal type; or</P></LI>

<LI><P>a <SPAN style="font-weight:bold;background-color:#A0FFA0">possibly cv-qualified</SPAN> class type (Clause
9 [class]) that has all of the following
properties:</P></LI>

<UL><LI><P>...</P></LI>

</UL>

</UL>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1929"></A><H4>1929.
  
<TT>template</TT> keyword following namespace <I>nested-name-specifier</I>
</H4><B>Section: </B>5.1.1&#160; [expr.prim.general]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-15<BR>


<P>It is not clear whether the <TT>template</TT> keyword should be
accepted in an example like</P>

<PRE>
  template&lt;typename&gt; struct s {};
  ::template s&lt;void&gt; q; //<SPAN style="font-family:Times;font-style:italic"> innocuous disambiguation?</SPAN>
</PRE>

<P>Although it is accepted by the grammar, the verbiage in
5.1.1 [expr.prim.general] paragraph 10 does not mention the possibility,
while the preceding paragraph dealing with class qualification calls
it out explicitly.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG agreed that this usage should be accepted.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 5.1.1 [expr.prim.general] paragraph 10 as follows (the
base wording is as modified by <A HREF="
     cwg_defects.html#1887">issue 1887</A>):</P>

<BLOCKQUOTE>

The <I>nested-name-specifier</I> <TT>::</TT> names the
global namespace. A <I>nested-name-specifier</I> that names
a namespace (7.3 [basic.namespace]), <SPAN style="font-weight:bold;background-color:#A0FFA0">optionally
followed by the keyword <TT>template</TT>
(14.2 [temp.names]), and then</SPAN> followed by the
name of a member of that namespace (or the name of a member
of a namespace made visible by a <I>using-directive</I>), is
a <I>qualified-id</I>...

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1942"></A><H4>1942.
  
Incorrect reference to <I>trailing-return-type</I>
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-16<BR>


<P>According to 5.1.2 [expr.prim.lambda] paragraph 4,</P>

<BLOCKQUOTE>

If a <I>lambda-expression</I> does not include
a <I>lambda-declarator</I>, it is as if
the <I>lambda-declarator</I> were <TT>()</TT>. The lambda return
type is <TT>auto</TT>, which is replaced by
the <I>trailing-return-type</I> if provided...

</BLOCKQUOTE>

<P><I>trailing-return-type</I> is a syntactic nonterminal that
includes the <TT>-&gt;</TT> and thus cannot be used directly to
refer to the type.  It should instead say something like, ...the
type specified by the <I>trailing-return-type</I>.</P>

<P>The reference in 8.3.5 [dcl.fct]
paragraph 2, &#8220;...returning
<I>trailing-return-type</I>&#8221; should be similarly adjusted.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 5.1.2 [expr.prim.lambda] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

If a <I>lambda-expression</I> does not include
a <I>lambda-declarator</I>, it is as if
the <I>lambda-declarator</I> were <TT>()</TT>. The lambda return type
is <TT>auto</TT>, which is replaced by <SPAN style="font-weight:bold;background-color:#A0FFA0">the type specified by</SPAN>
the <I>trailing-return-type</I> if provided and/or deduced
from <TT>return</TT> statements as described in
7.1.6.4 [dcl.spec.auto]. [<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change 8.3.5 [dcl.fct] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

The type of the <I>declarator-id</I> in <TT>D</TT> is
&#8220;<I>derived-declarator-type-list</I> function of
(<I>parameter-declaration-clause</I>) <I>cv-qualifier-seq<SUB>opt</SUB></I>
<I>ref-qualifier<SUB>opt</SUB></I>
returning <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><I>trailing-return-type</I></SPAN> <TT>U</TT>&#8221;<SPAN style="font-weight:bold;background-color:#A0FFA0">,
where <TT>U</TT> is the type specified by the
<I>trailing-return-type</I></SPAN>.  The
optional <I>attribute-specifier-seq</I>...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1920"></A><H4>1920.
  
Qualification mismatch in <I>pseudo-destructor-name</I>
</H4><B>Section: </B>5.2.4&#160; [expr.pseudo]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>David Majnemer
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-01<BR>


<P>An example like</P>

<PRE>
  typedef int T;
  typedef const T CT;

  void blah2(T *a) {
   a-&gt;CT::~T();
  }
</PRE>

<P>is ill-formed, because 5.2.4 [expr.pseudo] paragraph 2
requires that the two <I>type-name</I>s in the <I>qualified-id</I>
be the same type.  The corresponding case for a real destructor,
however, is allowed because of the provision in 9.1 [class.name]
paragraph 5 ignoring cv-qualifiers in a <I>typedef-name</I> referring
to a class type.  The specification for pseudo-destructors should be
adjusted accordingly.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 5.2.4 [expr.pseudo] paragraph 2 as follows:</P>

<BLOCKQUOTE>

<P>...The cv-unqualified versions of the object type and of the
type designated by the <I>pseudo-destructor-name</I> shall
be the same type. Furthermore, the two <I>type-name</I>s in
a <I>pseudo-destructor-name</I> of the form</P>

<UL><I>nested-name-specifier<SUB>opt</SUB> type-name</I> <TT>:: ~</TT> <I>type-name</I></UL>

<P>shall designate the same scalar type <SPAN style="font-weight:bold;background-color:#A0FFA0">(ignoring
cv-qualification)</SPAN>.</P>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1971"></A><H4>1971.
  
Unclear disambiguation of destructor and <TT>operator~</TT>
</H4><B>Section: </B>5.3.1&#160; [expr.unary.op]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-15<BR>




<P>There is language in 5.3.1 [expr.unary.op] paragraph
10 to disambiguate destructor references from references
to <TT>operator~</TT>:</P>

<BLOCKQUOTE>

There is an ambiguity in
the <I>unary-expression</I> <TT>~X()</TT>, where <TT>X</TT>
is a <I>class-name</I> or <I>decltype-specifier</I>. The
ambiguity is resolved in favor of treating <TT>~</TT> as a
unary complement rather than treating <TT>~X</TT> as
referring to a destructor.

</BLOCKQUOTE>

<P>However, it is not clear whether this is intended to apply
to an example like,</P>

<PRE>
  struct X {
    X(int);
    operator int();
    void foo() {
      ~X(0);
    }
  };
</PRE>

<P>where the form of reference has an apparent argument.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 5.3.1 [expr.unary.op] paragraph 10 as follows:</P>

<BLOCKQUOTE>

The operand of <TT>~</TT> shall have integral or unscoped enumeration type; the
result is the one's complement of its operand. Integral promotions are
performed. The type of the result is the type of the promoted operand.
There is an ambiguity <SPAN style="text-decoration:line-through;background-color:#FFA0A0">in the <I>unary-expression</I> <TT>~X()</TT>,
where <TT>X</TT> is</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">in the grammar when <TT>~</TT> is followed
by</SPAN> a <I>class-name</I> or <I>decltype-specifier</I>. The ambiguity is
resolved <SPAN style="text-decoration:line-through;background-color:#FFA0A0">in favor of</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">by</SPAN> treating <TT>~</TT>
as <SPAN style="text-decoration:line-through;background-color:#FFA0A0">a</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">the</SPAN> unary complement <SPAN style="font-weight:bold;background-color:#A0FFA0">operator</SPAN> rather
than <SPAN style="text-decoration:line-through;background-color:#FFA0A0">treating <TT>~X</TT> as referring to</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">as
the start of an <I>unqualified-id</I> naming</SPAN> a
destructor. <SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I> Because the grammar does not permit an
operator to follow the <TT>.</TT>, <TT>-&gt;</TT>, or <TT>::</TT> tokens,
a <TT>~</TT> followed by a <I>class-name</I> or <I>decltype-specifier</I>
in a member access expression or <I>qualified-id</I> is unambiguously
parsed as a destructor name. &#8212;<I>end note</I>]</SPAN>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1925"></A><H4>1925.
  
Bit-field prvalues
</H4><B>Section: </B>5.19&#160; [expr.comma]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-12<BR>


<P>According to 5.19 [expr.comma] paragraph 1,</P>

<BLOCKQUOTE>

The type and value of the result are the type and value of the right
operand; the result is of the same value category as its right operand, and
is a bit-field if its right operand is a glvalue and a bit-field.

</BLOCKQUOTE>

<P>The description of a bit-field result seems to indicate that the
operand might not be a glvalue but could still be a bit-field.  There
doesn't appear to be a normative prohibition against prvalue
bit-fields, so one should presumably be added, and this wording
should be adjusted to remove the suggestion that such a thing might
exist.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 3.10 [basic.lval] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

Whenever a glvalue appears in a context where a prvalue is
expected, the glvalue is converted to a prvalue; see
4.1 [conv.lval], 4.2 [conv.array], and
4.3 [conv.func]. [<I>Note:</I> An attempt to bind
an rvalue reference to an lvalue is not such a context; see
8.5.3 [dcl.init.ref]. &#8212;<I>end note</I>]
<SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I> There are no prvalue bit-fields; if a
bit-field is converted to a prvalue (4.1 [conv.lval]),
a prvalue of the type of the bit-field is created, which might
then be promoted (4.5 [conv.prom]). &#8212;<I>end note</I>]</SPAN>

</BLOCKQUOTE>

<LI><P>Change 5.19 [expr.comma] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...The type and value of the result are the type and value
of the right operand; the result is of the same value
category as its right operand, and is a bit-field if its
right operand is <SPAN style="text-decoration:line-through;background-color:#FFA0A0">a glvalue and</SPAN> a bit-field. If
the value...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1952"></A><H4>1952.
  
Constant expressions and library undefined behavior
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-22<BR>




<P>According to bullet 2.5 of 5.20 [expr.const],</P>

<BLOCKQUOTE>

<P>A <I>conditional-expression</I> <TT>e</TT> is a core constant
expression unless the evaluation of <TT>e</TT>, following the rules
of the abstract machine (1.9 [intro.execution]), would
evaluate one of the following expressions:</P>

<UL><LI><P>...</P></LI>

<LI>

<P>an operation that would have undefined behavior
[<I>Note:</I> including, for example, signed integer
overflow (Clause 5 [expr]), certain pointer
arithmetic (5.7 [expr.add]), division by zero
(5.6 [expr.mul]), or certain shift operations
(5.8 [expr.shift]) &#8212;<I>end note</I>];</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>The definition of &#8220;operation&#8221; is unclear.  In
particular, is it intended to include use of library components
that are specified to produce undefined behavior, such as use of
the <TT>offsetof</TT> macro when applied to a non-standard-layout
class?</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<OL><LI><P>Change 5.20 [expr.const] bullet 2.5 as follows:</P></LI>

<UL><LI><P>an operation that would have undefined behavior
<SPAN style="font-weight:bold;background-color:#A0FFA0">as specified in Clauses 1 [intro] through
16 [cpp] of this International Standard</SPAN>
[<I>Note:</I> including, for example, signed integer overflow (Clause
5 [expr]), certain pointer arithmetic
(5.7 [expr.add]), division by zero
(5.6 [expr.mul]), or certain shift operations
(5.8 [expr.shift]) &#8212;<I>end note</I>];</P></LI></UL>

<LI><P>Add the following at the end of 5.20 [expr.const]
paragraph 2:</P></LI>

<BLOCKQUOTE>

<SPAN style="font-weight:bold;background-color:#A0FFA0">If <TT>e</TT> satisfies the constraints of a core constant
expression, but evaluation of <TT>e</TT> would evaluate an operation
that has undefined behavior as specified in Clauses
17 [library] through 30 [thread] of this
International Standard, it is unspecified whether <TT>e</TT> is a
core constant expression.</SPAN>

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1247"></A><H4>1247.
  
Restriction on alias name appearing in <I>type-id</I>
</H4><B>Section: </B>7.1.3&#160; [dcl.typedef]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2011-02-26<BR>




<P>With the resolution of <A HREF="
     cwg_defects.html#1044">issue 1044</A>,
there is no need to say that the name of the alias cannot appear in
the <I>type-id</I> of the declaration.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 7.1.3 [dcl.typedef] paragraph 2 as follows:</P>

<BLOCKQUOTE>

A <I>typedef-name</I> can also be introduced by
an <I>alias-declaration</I>. The <I>identifier</I> following
the <TT>using</TT> keyword becomes a <I>typedef-name</I> and the
optional <I>attribute-specifier-seq</I> following
the <I>identifier</I> appertains to that <I>typedef-name</I>. It
has the same semantics as if it were introduced by
the <TT>typedef</TT> specifier. In particular, it does not define
a new type<SPAN style="text-decoration:line-through;background-color:#FFA0A0"> and it shall not appear in
the <I>type-id</I></SPAN>. [<I>Example:</I>...

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1958"></A><H4>1958.
  
<TT>decltype(auto)</TT> with parenthesized initializer
</H4><B>Section: </B>7.1.6.4&#160; [dcl.spec.auto]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Vinny Romano
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-30<BR>




<P>According to 7.1.6.4 [dcl.spec.auto] paragraph 7,</P>

<BLOCKQUOTE>

If the placeholder is the
<TT>decltype(auto)</TT> <I>type-specifier</I>, the declared type of
the variable or return type of the function shall be the
placeholder alone. The type deduced for the variable or
return type is determined as described in
7.1.6.2 [dcl.type.simple], as though the initializer had
been the operand of the <TT>decltype</TT>.

</BLOCKQUOTE>

<P>This is problematic when the parenthesized form of <I>initializer</I>
is used, e.g.,</P>

<PRE>
  int i;
  decltype(auto) x(i);
</PRE>

<P>the specification would deduce the type as <TT>decltype((i))</TT>,
or <TT>int&amp;</TT>.  The wording should be clarified that the
<I>expression</I> and not the entire <I>initializer</I> is considered
to be the operand of <TT>decltype</TT>.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 7.1.6.4 [dcl.spec.auto] paragraph 7 as follows:</P>

<BLOCKQUOTE>

...If the placeholder is
the <TT>decltype(auto)</TT> <I>type-specifier</I>, the declared
type of the variable or return type of the function shall be the
placeholder alone. The type deduced for the variable or return
type is determined as described in 7.1.6.2 [dcl.type.simple],
as though
the <SPAN style="text-decoration:line-through;background-color:#FFA0A0">initializer</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0"><i>initializer-clause</i>
or <I>expression-list</I> of the <I>initializer</I> or
the <I>expression</I> of the <TT>return</TT> statement</SPAN> had
been the operand of the decltype. [<I>Example:</I>

<PRE>
  int i;
  int&amp;&amp; f();
<SPAN style="font-weight:bold;background-color:#A0FFA0">  auto           x2a(i);    //<SPAN style="font-family:Times;font-style:italic"> </SPAN>decltype(x2a)<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int
  decltype(auto) x2d(i);    //<SPAN style="font-family:Times;font-style:italic"> </SPAN>decltype(x2d)<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int</SPAN>
  auto           x3a = i;   //<SPAN style="font-family:Times;font-style:italic"> </SPAN>decltype(x3a)<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int
  decltype(auto) x3d = i;   //<SPAN style="font-family:Times;font-style:italic"> </SPAN>decltype(x3d)<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int
  ...
</PRE>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1966"></A><H4>1966.
  
Colon following enumeration <I>elaborated-type-specifier</I>
</H4><B>Section: </B>7.2&#160; [dcl.enum]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-08<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#1514">issue 1514</A> was intended
to apply whenever <TT>enum</TT> <I>identifier</I> appears; however, the
fact that the disambiguation rule appears in the description of the
<I>enum-specifier</I> makes it unclear that it is intended to apply in
other contexts such as:</P>

<PRE>
  enum E { e1 };
  void f() {
    false ? new enum E : int();
  }
</PRE>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 7.2 [dcl.enum] paragraph 1 as follows:</P>

<BLOCKQUOTE>

A <TT>:</TT> following &#8220;<TT>enum</TT> <I>identifier</I>&#8221; 
<SPAN style="font-weight:bold;background-color:#A0FFA0">within the <I>decl-specifier-seq</I> of
a <I>member-declaration</I></SPAN> is parsed as part of
an <I>enum-base</I>. [<I>Note:</I> This resolves a potential
ambiguity between the declaration of an enumeration with
an <I>enum-base</I> and the declaration of an unnamed bit-field
of enumeration type...

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1888"></A><H4>1888.
  
Implicitly-declared default constructors and <TT>explicit</TT>
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-04<BR>




<P>It used to be clear that an implicitly-declared default constructor
is not <TT>explicit</TT>.  That has been inadvertently lost due to other
changes, so this specification should be added to 12.1 [class.ctor]
in parallel with the similar statement in 12.8 [class.copy]
paragraph 3.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 12.1 [class.ctor] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

A <I>default</I> constructor for a class <TT>X</TT> is a
constructor of class <TT>X</TT> that can be called without
an argument. If there is no user-declared constructor for
class <TT>X</TT>, a <SPAN style="font-weight:bold;background-color:#A0FFA0">non-<TT>explicit</TT></SPAN>
constructor having no parameters is implicitly declared as
defaulted (8.4 [dcl.fct.def]). An implicitly-declared
default constructor...

</BLOCKQUOTE>

<LI><P>Change 12.3.1 [class.conv.ctor] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

A non-explicit copy/move constructor
(12.8 [class.copy]) is a converting
constructor. <SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I></SPAN> An implicitly-declared
copy/move constructor is not an explicit constructor; it may
be called for implicit type conversions. <SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end
note</I>]</SPAN>

</BLOCKQUOTE>

<LI><P>Change 12.8 [class.copy] paragraph 7 as follows:</P></LI>

<BLOCKQUOTE>

If the class definition does not explicitly declare a copy
constructor, <SPAN style="font-weight:bold;background-color:#A0FFA0">a non-<TT>explicit</TT></SPAN> one is
declared <I>implicitly</I>. If the class...

</BLOCKQUOTE>

<LI><P>Change 12.8 [class.copy] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

If the definition of a class <TT>X</TT> does not explicitly
declare a move constructor, <SPAN style="font-weight:bold;background-color:#A0FFA0">a
non-<TT>explicit</TT></SPAN> one will be implicitly declared
as defaulted if and only if...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1978"></A><H4>1978.
  
Redundant description of explicit constructor use
</H4><B>Section: </B>12.3.1&#160; [class.conv.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Geoffrey Romer
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-22<BR>




<P>The conditions under which an <TT>explicit</TT> constructor will
be used are given in 12.3.1 [class.conv.ctor] paragraph 2:</P>

<BLOCKQUOTE>

An explicit constructor constructs objects just like
non-explicit constructors, but does so only where the
direct-initialization syntax (8.5 [dcl.init]) or
where casts (5.2.9 [expr.static.cast],
5.4 [expr.cast]) are explicitly used. A default
constructor may be an explicit constructor; such a
constructor will be used to perform default-initialization
or value-initialization (8.5 [dcl.init]).

</BLOCKQUOTE>

<P>The existence of this wording in normative text is confusing
and should probably simply say that <TT>explicit</TT> constructors
are used in direct initialization, with cross-references to
8.5 [dcl.init] and 13.3.1.4 [over.match.copy],
possibly as a note.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 12.3.1 [class.conv.ctor] paragraph 2 as follows:</P>

<BLOCKQUOTE>

<SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I></SPAN> An explicit constructor constructs
objects just like non-explicit constructors, but does so only
where the direct-initialization syntax (8.5 [dcl.init])
or where casts (5.2.9 [expr.static.cast],
5.4 [expr.cast]) are explicitly used<SPAN style="font-weight:bold;background-color:#A0FFA0">; see also
13.3.1.4 [over.match.copy]</SPAN>. A default constructor may be
an explicit constructor; such a constructor will be used to
perform default-initialization or value-initialization
(8.5 [dcl.init]). [<I>Example:</I> ...  &#8212;<I>end
example</I>] <SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end note</I>]</SPAN>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1916"></A><H4>1916.
  
&#8220;Same cv-unqualified type&#8221;
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-18<BR>




<P>12.8 [class.copy] paragraph 31 uses the phrase,
&#8220;same cv-unqualified type,&#8221; twice.  This is ambiguous,
potentially either requiring that the types not be cv-qualified or
meaning that cv-qualification should be ignored.  The latter meaning
is intended and the phrase should be replaced accordingly.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 12.8 [class.copy] paragraph 31 as follows:</P>

<BLOCKQUOTE>

<P>...This elision of copy/move operations, called <I>copy elision</I>,
is permitted in the following circumstances (which may be
combined to eliminate multiple copies):</P>

<OL><LI><P>in a <TT>return</TT> statement in a function with
a class return type, when
the <SPAN style="text-decoration:line-through;background-color:#FFA0A0">expression</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0"><I>expression</I></SPAN> is
the name of a non-volatile automatic object (other than a
function <SPAN style="text-decoration:line-through;background-color:#FFA0A0">or catch-clause</SPAN> parameter <SPAN style="font-weight:bold;background-color:#A0FFA0">or a
variable introduced by the <I>exception-declaration</I> of
a <I>handler</I> (15.3 [except.handle])</SPAN>) with the same
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">cv-unqualified</SPAN> type <SPAN style="font-weight:bold;background-color:#A0FFA0">(ignoring
cv-qualification)</SPAN> as the function return type, the
copy/move operation can be omitted by constructing the
automatic object directly into the function's return
value</P></LI>

<LI><P>in a <I>throw-expression</I>...</P></LI>

<LI><P>when a temporary class object that has not been bound to a
reference (12.2 [class.temporary]) would be copied/moved
to a class object with the same <SPAN style="text-decoration:line-through;background-color:#FFA0A0">cv-unqualified</SPAN> type
<SPAN style="font-weight:bold;background-color:#A0FFA0">(ignoring cv-qualification)</SPAN>, the
copy/move operation can be omitted by constructing the
temporary object directly into the target of the omitted
copy/move</P></LI>

<LI><P>when the <I>exception-declaration</I>...</P></LI>

</OL>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1967"></A><H4>1967.
  
Temporary lifetime and move-elision
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-11<BR>




<P>When copy elision is performed, the lifetime of the
merged object ends at the later of the times the two
objects' lifetimes would have ended.  If the copy elision is
done using a move constructor, however, it might make sense
to assume that the moved-from object's lifetime is no longer
interesting and the lifetime should be that of the moved-to
object.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<P>Change 12.8 [class.copy] paragraph 31 as follows:</P>

<BLOCKQUOTE>

When certain criteria are met, an implementation is allowed to
omit the copy/move construction of a class object, even if the
constructor selected for the copy/move operation and/or the
destructor for the object have side effects. In such cases, the
implementation treats the source and target of the omitted
copy/move operation as simply two different ways of referring to
the same object<SPAN style="text-decoration:line-through;background-color:#FFA0A0">, and</SPAN><SPAN style="font-weight:bold;background-color:#A0FFA0">. If the first parameter of the
selected constructor is an rvalue reference to the object's type,</SPAN>
the destruction of that object occurs <SPAN style="font-weight:bold;background-color:#A0FFA0">when the target would have
been destroyed; otherwise, the destruction occurs</SPAN> at the
later of the times when the two objects would have been destroyed
without the optimization.<SUP>122</SUP> This elision of copy/move
operations, called <I>copy elision</I>, is permitted...

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1922"></A><H4>1922.
  
Injected class template names and default arguments
</H4><B>Section: </B>14.6.1&#160; [temp.local]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-05<BR>




<P>Use of the injected-class-name of a class template with a
<I>template-argument-list</I> that relies on default arguments is
not clearly specified in the current wording of the Standard.  In
particular, according to 14.1 [temp.param] paragraph 10,</P>

<BLOCKQUOTE>

The set of default <I>template-argument</I>s available for use with a
template declaration or definition is obtained by merging the default
arguments from the definition (if in scope) and all declarations in scope
in the same way default function arguments are
(8.3.6 [dcl.fct.default]).

</BLOCKQUOTE>

<P>However, the injected-class-name hides the template declarations,
so it is not clear whether the default arguments are available at
that point or not.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 14.1 [temp.param] paragraph 10 as follows:</P>

<BLOCKQUOTE>

The set of default <I>template-argument</I>s available for
use <SPAN style="text-decoration:line-through;background-color:#FFA0A0">with a template declaration or definition</SPAN> is
obtained by merging the default arguments from <SPAN style="text-decoration:line-through;background-color:#FFA0A0">the
definition (if in scope) and</SPAN> all <SPAN style="font-weight:bold;background-color:#A0FFA0">prior</SPAN>
declarations <SPAN style="text-decoration:line-through;background-color:#FFA0A0">in scope</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">of the template</SPAN>
in the same way default function arguments are
(8.3.6 [dcl.fct.default]). [<I>Example:</I>...

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1988"></A><H4>1988.
  
Ambiguity between dependent and non-dependent bases in implicit member access
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-22<BR>




<P>According to 14.6.2.1 [temp.dep.type] paragraph 7,</P>

<BLOCKQUOTE>

If, for a given set of template arguments, a specialization of a template
is instantiated that refers to a member of the current instantiation with
a <I>qualified-id</I> or class member access expression, the name in
the <I>qualified-id</I> or class member access expression is looked up in
the template instantiation context. If the result of this lookup differs
from the result of name lookup in the template definition context, name
lookup is ambiguous.  [<I>Note:</I> the result of name lookup differs only
when the member of the current instantiation was found in a non-dependent
base class of the current instantiation and a member with the same name is
also introduced by the substitution for a dependent base class of the
current instantiation. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>It is not clear whether this applies to an example like,</P>

<PRE>
   struct A { int n; };
   struct B { int n; };
   template&lt;typename T&gt; struct C : T, B {
     int f() { return n; }
   };
   int k = C&lt;A&gt;().f();
</PRE>

<P>since the reference to <TT>n</TT> is transformed into a class
member access expression, per 9.3.1 [class.mfct.non-static] paragraph 3.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>The transformation to a member access expression or
<I>qualified-id</I> should be performed only in the instantiated
function, not when processing the template definition.</P>

<P><B>Proposed resolution (April, 2015):</B></P>

<OL><LI><P>Change 9.3.1 [class.mfct.non-static] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

When an <I>id-expression</I> (5.1 [expr.prim]) that is
not part of a class member access syntax
(5.2.5 [expr.ref]) and not used to form a pointer to
member (5.3.1 [expr.unary.op]) is used in a member of class
<TT>X</TT> in a context where <TT>this</TT> can be used
(5.1.1 [expr.prim.general]), if name lookup
(3.4 [basic.lookup]) resolves the name in
the <I>id-expression</I> to a non-static non-type member of some
class <TT>C</TT>, and if either the <I>id-expression</I> is
potentially evaluated or <TT>C</TT> is <TT>X</TT> or a base class
of <TT>X</TT>, the <I>id-expression</I> is transformed into a
class member access expression (5.2.5 [expr.ref])
using <TT>(*this)</TT> (9.3.2 [class.this]) as
the <I>postfix-expression</I> to the left of the <TT>.</TT>
operator. [<I>Note:</I> If <TT>C</TT> is not <TT>X</TT> or a base
class of <TT>X</TT>, the class member access expression is
ill-formed. &#8212;<I>end note</I>] Similarly during name lookup,
when an <I>unqualified-id</I> (5.1 [expr.prim]) used in
the definition of a member function for class <TT>X</TT> resolves
to a <TT>static</TT> member, an enumerator or a nested type of
class <TT>X</TT> or of a base class of <TT>X</TT>,
the <I>unqualified-id</I> is transformed into
a <I>qualified-id</I> (5.1 [expr.prim]) in which
the <I>nested-name-specifier</I> names the class of the member
function. <SPAN style="font-weight:bold;background-color:#A0FFA0">These transformations do not apply in the template
definition context (14.6.2.1 [temp.dep.type]).</SPAN>
[<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change the example in 14.6.2.1 [temp.dep.type] paragraph
7, as modified by the resolution of <A HREF="
     cwg_active.html#1309">issue 1309</A>,
as follows:</P></LI>

<BLOCKQUOTE>

<PRE>
  struct A {
    int m;
  };

  struct B {
    int m;
  };

  template&lt;typename T&gt;
  struct C : A, T {
    int f() { return this-&gt;m; }//<SPAN style="font-family:Times;font-style:italic"> finds </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> in the template definition context</SPAN>
  <SPAN style="font-weight:bold;background-color:#A0FFA0">  int g() { return m; }      //<SPAN style="font-family:Times;font-style:italic"> finds </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> in the template definition context</SPAN></SPAN>
  };

  template int C&lt;B&gt;::f();      //<SPAN style="font-family:Times;font-style:italic"> error: finds both </SPAN>A::m<SPAN style="font-family:Times;font-style:italic"> and </SPAN>B::m
<SPAN style="font-weight:bold;background-color:#A0FFA0">  template int C&lt;B&gt;::g();      //<SPAN style="font-family:Times;font-style:italic"> OK: transformation to class member access syntax</SPAN>
                               //<SPAN style="font-family:Times;font-style:italic"> does not occur in the template definition context; see 9.3.1 [class.mfct.non-static]</SPAN></SPAN>
</PRE>

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1899"></A><H4>1899.
  
Value-dependent constant expressions
</H4><B>Section: </B>14.6.2.3&#160; [temp.dep.constexpr]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-22<BR>


<P>14.6.2.3 [temp.dep.constexpr] paragraph 1 begins,</P>

<BLOCKQUOTE>

Except as described below, a constant expression is value-dependent if...

</BLOCKQUOTE>

<P>However, this terminology is misleading, because &#8220;constant
expression&#8221; is now defined in terms of evaluation, and a
value-dependent expression cannot be evaluated.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 14.6.2.1 [temp.dep.type] paragraph 8
as follows:</P></LI>

<BLOCKQUOTE>

<P>A type is dependent if it is</P>

<UL><LI><P>...</P></LI>

<LI><P>an array type <SPAN style="text-decoration:line-through;background-color:#FFA0A0">constructed from
any</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">whose element type is</SPAN>
dependent <SPAN style="text-decoration:line-through;background-color:#FFA0A0">type</SPAN> or whose
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">size</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">bound (if any)</SPAN> is <SPAN style="text-decoration:line-through;background-color:#FFA0A0">specified
by a constant expression that is</SPAN>
value-dependent,</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change 14.6.2.3 [temp.dep.constexpr] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

Except as described below, <SPAN style="text-decoration:line-through;background-color:#FFA0A0">a
constant</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">an</SPAN> expression <SPAN style="font-weight:bold;background-color:#A0FFA0">used in a
context where a constant expression is required</SPAN> is
value-dependent if any subexpression is value-dependent.

</BLOCKQUOTE>

</OL>

<BR><BR><BR><BR><HR><A NAME="Review Status"></A><H3>Issues with "Review" Status</H3>
<HR><A NAME="554"></A><H4>554.
  
Definition of &#8220;declarative region&#8221; and &#8220;scope&#8221;
</H4><B>Section: </B>3.3&#160; [basic.scope]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>29 December 2005<BR>




<P>The various uses of the term &#8220;declarative region&#8221;
throughout the Standard indicate that the term is intended to refer
to the entire block, class, or namespace that contains a given
declaration.  For example, 3.3 [basic.scope] paragraph 2
says, in part:</P>

<BLOCKQUOTE>

<P>[<I>Example:</I> in</P>

<PRE>
    int j = 24;
    int main()
    {
        int i = j, j;
        j = 42;
    }
</PRE>

<P>The declarative region of the first <TT>j</TT> includes the entire
example... The declarative region of the second declaration
of <TT>j</TT> (the <TT>j</TT> immediately before the semicolon)
includes all the text between <TT>{</TT> and <TT>}</TT>...</P>

</BLOCKQUOTE>

<P>However, the actual definition given for &#8220;declarative
region&#8221; in 3.3 [basic.scope] paragraph 1
does not match this usage:</P>

<BLOCKQUOTE>

Every name is introduced in some portion of program text called a
<I>declarative region</I>, which is the largest part of the program in
which that name is <I>valid</I>, that is, in which that name may be
used as an unqualified name to refer to the same entity.

</BLOCKQUOTE>

<P>Because (except in class scope) a name cannot be used before
it is declared, this definition contradicts the statement in the
example and many other uses of the term throughout the Standard.
As it stands, this definition is identical to that of the scope
of a name.</P>

<P>The term &#8220;scope&#8221; is also misused.  The scope of a
declaration is defined in 3.3 [basic.scope] paragraph 1 as
the region in which the name being declared is valid.  However, there
is frequent use of the phrase &#8220;the scope of a class,&#8221; not
referring to the region in which the class's name is valid but to the
declarative region of the class body, and similarly for namespaces,
functions, exception handlers, etc.  There is even a mention of
looking up a name &#8220;in the scope of the
complete <I>postfix-expression</I>&#8221; (3.4.5 [basic.lookup.classref] paragraph 3), which is the exact inverse of the scope
of a declaration.</P>

<P>This terminology needs a thorough review to make it logically
consistent.  (Perhaps a discussion of the scope of template
parameters could also be added to section 3.3 [basic.scope]
at the same time, as all other kinds of scopes are described there.)</P>

<P><B>Proposed resolution (November, 2006):</B></P>

<OL>
<LI><P>Change 3.3 [basic.scope] paragraph 1 as follows:
</P></LI>

<BLOCKQUOTE>

Every name is introduced in some portion of program text called a
<I>declarative region</I>, which is <SPAN style="text-decoration:line-through;background-color:#FFA0A0">the largest part of the
program in which that name is <I>valid</I>, that is, in which
that name may be used as an unqualified name to refer to the same
entity</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a <I>statement</I>, block, function declarator,
<I>function-definition</I>, class, handler, <I>template-declaration</I>,
<I>template-parameter-list</I> of a template
<I>template-parameter</I>, or namespace</SPAN>. In general, each
particular name <SPAN style="text-decoration:line-through;background-color:#FFA0A0">is valid</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">may be used as an unqualified
name to refer to the entity of its declaration or to the
label</SPAN> only within some possibly discontiguous portion of
program text called its <I>scope</I>. To determine the scope of a
declaration...

</BLOCKQUOTE>

<LI><P>Change 3.3 [basic.scope] paragraph 3 as follows:
</P></LI>

<BLOCKQUOTE>

The names declared by a declaration are introduced into the
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">scope in which the declaration occurs</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">declarative
region that directly encloses the declaration</SPAN>, except that
<SPAN style="font-weight:bold;background-color:#A0FFA0"><I>declaration-statement</I>s, function parameter names in the
declarator of a <I>function-definition</I>,
<I>exception-declaration</I>s (3.3.3 [basic.scope.block]),</SPAN>
the presence of a <TT>friend</TT> specifier (11.3 [class.friend]), certain uses of the
<I>elaborated-type-specifier</I> (7.1.6.3 [dcl.type.elab]),
and <I>using-directive</I>s (7.3.4 [namespace.udir]) alter
this general behavior.

</BLOCKQUOTE>

<LI><P>Change 3.3.3 [basic.scope.block] paragraphs 1-3 and add a
new paragraph 4 before the existing paragraph 4 as follows:
</P></LI>

<BLOCKQUOTE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">A name declared in a block (6.3 [stmt.block]) is
local to that block. Its potential scope begins at its point of
declaration (3.3.2 [basic.scope.pdecl]) and ends at the end of
its declarative region.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">The declarative region of a name
declared in a <I>declaration-statement</I> is the directly
enclosing block (6.3 [stmt.block]). Such a name is local
to the block.</SPAN></P>

<P>The <SPAN style="text-decoration:line-through;background-color:#FFA0A0">potential scope</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">declarative region</SPAN> of a
function parameter name <SPAN style="text-decoration:line-through;background-color:#FFA0A0">(including one appearing </SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">in
the declarator of a <I>function-definition</I> or</SPAN> in a
<I>lambda-parameter-declaration-clause</I><SPAN style="text-decoration:line-through;background-color:#FFA0A0">)</SPAN> or of a
function-local predefined variable in a function definition
(8.4 [dcl.fct.def]) <SPAN style="text-decoration:line-through;background-color:#FFA0A0">begins at its point of
declaration. If the function has a <I>function-try-block</I> the
potential scope of a parameter or of a function-local predefined
variable ends at the end of the last associated handler,
otherwise it ends at the end of the outermost block of the
function definition. A parameter name</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">is the entire
function definition or <I>lambda-expression</I>. Such a name is
local to the function definition and</SPAN> shall not be redeclared
in <SPAN style="text-decoration:line-through;background-color:#FFA0A0">the</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">any</SPAN> outermost block of the <SPAN style="text-decoration:line-through;background-color:#FFA0A0">function
definition nor in the outermost block of any handler associated
with a <I>function-try-block</I></SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0"><I>function-body</I> (including handlers of a
<I>function-try-block</I>) or <I>lambda-expression</I></SPAN>.</P>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">The name in a <TT>catch</TT> exception-declaration</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">The declarative region of a name declared in an
<I>exception-declaration</I> is its entire handler. Such a
name</SPAN> is local to the handler and shall not be redeclared in
the outermost block of the handler.</P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">The potential scope of any local name begins at its point
of declaration (3.3.2 [basic.scope.pdecl]) and ends at the end
of its declarative region.</SPAN></P>

</BLOCKQUOTE>

<LI><P>Change 3.3.5 [basic.funscope] as indicated:
</P></LI>

<BLOCKQUOTE>

Labels (6.1 [stmt.label]) have <I>function scope</I> and
may be used anywhere in the function in which they are declared
<SPAN style="font-weight:bold;background-color:#A0FFA0">except in members of local classes (9.8 [class.local])
of that function</SPAN>. Only labels have function scope.

</BLOCKQUOTE>

<LI><P>Change 6.7 [stmt.dcl] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

<P>A declaration statement introduces one or more new <SPAN style="text-decoration:line-through;background-color:#FFA0A0">identifiers</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">names</SPAN> into a block; it has the form</P>

<UL>
<I>declaration-statement:</I>
<UL>
<I>block-declaration</I>
</UL></UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I></SPAN> If <SPAN style="text-decoration:line-through;background-color:#FFA0A0">an identifier</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a name</SPAN>
introduced by a declaration was previously declared in an outer
block, the outer declaration is hidden for the remainder of the
block, after which it resumes its force <SPAN style="font-weight:bold;background-color:#A0FFA0">(3.3.10 [basic.scope.hiding])</SPAN>. <SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end note</I>]</SPAN></P>

</BLOCKQUOTE>
</OL>

<P><I>[Drafting notes: This resolution deals almost exclusively
with the unclear definition of &#8220;declarative region.&#8221;
I've left the ambiguous use of &#8220;scope&#8221; alone for now.
However sections 3.3.x all have headings reading &#8220;xxx
scope,&#8221; but they don't mean the scope of a declaration but
the different kinds of declarative regions and their effects on
the scope of declarations contained therein. To me, it looks like
most of 3.4 should refer to &#8220;declarative region&#8221; and
not to &#8220;scope.&#8221;</I></P>

<P><I>The change to 6.7 fixes an &#8220;identifier&#8221; misuse
(e.g., <TT>extern T operator+(T,T);</TT> at block scope
introduces a name but not an identifier) and removes normative
redundancy.]</I></P>

<BR><BR><HR><A NAME="2011"></A><H4>2011.
  
Unclear effect of reference capture of reference
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Ville Voutilainen
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-28<BR>




<P>The Standard refers to capturing &#8220;entities,&#8221; and a
reference is an entity.  However, it is not clear what capturing a
reference by reference would mean.  In particular, 5.1.2 [expr.prim.lambda]
paragraph 16 says,</P>

<BLOCKQUOTE>

It is unspecified whether additional unnamed non-static data
members are declared in the closure type for entities
captured by reference.

</BLOCKQUOTE>

<P>If a reference captured by reference is not represented by a
member, it is hard to see how something like the following
example could work:</P>

<PRE>
  #include &lt;functional&gt;
  #include &lt;iostream&gt;

  std::function&lt;void()&gt; make_function(int&amp; x) {
    return [&amp;]{ std::cout &lt;&lt; x &lt;&lt; std::endl; };
  }

  int main() {
    int i = 3;
    auto f = make_function(i);
    i = 5;
    f();
  }
</PRE>

<P>Should this be undefined behavior or should it print <TT>5</TT>?</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 5.1.2 [expr.prim.lambda] paragraph 18 as follows:</P></LI>

<BLOCKQUOTE>

<P>Every <I>id-expression</I> within
the <I>compound-statement</I> of a <I>lambda-expression</I>
that is an odr-use (3.2 [basic.def.odr]) of an entity captured by copy is
transformed into an access to the corresponding unnamed data
member of the closure type. [<I>Note:</I>
An <I>id-expression</I> that is not an odr-use refers to the
original entity, never to a member of the closure
type. Furthermore, such an <I>id-expression</I> does not
cause the implicit capture of the entity.  &#8212;<I>end
note</I>] If <TT>this</TT> is captured, each odr-use
of <TT>this</TT> is transformed into an access to the
corresponding unnamed data member of the closure type, cast
(5.4 [expr.cast]) to the type of <TT>this</TT>. [<I>Note:</I> The cast
ensures that the transformed expression is a
prvalue. &#8212;<I>end
note</I>] <SPAN style="font-weight:bold;background-color:#A0FFA0">An <I>id-expression</I> within
the <I>compound-statement</I> of a <I>lambda-expression</I>
that is an odr-use of a reference captured by reference
refers to the entity to which the captured reference is
bound and not to the captured reference. [<I>Note:</I> Such
odr-uses are not invalidated by the end of the captured
reference's lifetime. &#8212;<I>end note</I>]</SPAN>
[<I>Example:</I></P>

<PRE>
  void f(const int*);
  void g() {
    const int N = 10;
    [=] {
    int arr[N]; //<SPAN style="font-family:Times;font-style:italic"> OK: not an odr-use, refers to automatic variable</SPAN>
    f(&amp;N);      //<SPAN style="font-family:Times;font-style:italic"> OK: causes </SPAN>N<SPAN style="font-family:Times;font-style:italic"> to be captured; </SPAN>&amp;N<SPAN style="font-family:Times;font-style:italic"> points to the</SPAN>
                //<SPAN style="font-family:Times;font-style:italic"> corresponding member of the closure type</SPAN>
    };
  }
<SPAN style="font-weight:bold;background-color:#A0FFA0">  auto h(int &amp;r) {
    return [&amp;]() {
      ++r;      //<SPAN style="font-family:Times;font-style:italic"> Valid after </SPAN>h<SPAN style="font-family:Times;font-style:italic"> returns if the lifetime of the</SPAN>
                //<SPAN style="font-family:Times;font-style:italic"> object to which </SPAN>r<SPAN style="font-family:Times;font-style:italic"> is bound has not ended</SPAN>
    };
  }</SPAN>
</PRE>

<P>&#8212;<I>end example</I>]</P>

</BLOCKQUOTE>

<LI><P>Change 5.1.2 [expr.prim.lambda] paragraph 23 as follows:</P></LI>

<BLOCKQUOTE>

[<I>Note:</I> If <SPAN style="text-decoration:line-through;background-color:#FFA0A0">an</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a non-reference</SPAN> entity is
implicitly or explicitly captured by reference, invoking the function call
operator of the corresponding <I>lambda-expression</I> after the lifetime
of the entity has ended is likely to result in undefined
behavior. &#8212;<I>end note</I>]

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1930"></A><H4>1930.
  
<I>init-declarator-list</I> vs <I>member-declarator-list</I>
</H4><B>Section: </B>7.1.1&#160; [dcl.stc]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-19<BR>




<P>According to 7.1.1 [dcl.stc] paragraph 1,</P>

<BLOCKQUOTE>

If a <I>storage-class-specifier</I> appears in a <I>decl-specifier-seq</I>,
there can be no <TT>typedef</TT> specifier in the
same <I>decl-specifier-seq</I> and the <I>init-declarator-list</I> of the
declaration shall not be empty...

</BLOCKQUOTE>

<P>This obviously should apply to <TT>mutable</TT> but does not
because <TT>mutable</TT> applies to <I>member-declarator-list</I>s,
not <I>init-declarator-list</I>s.  Similarly, in
7.1.6.1 [dcl.type.cv] paragraph 1,</P>

<BLOCKQUOTE>

If a <I>cv-qualifier</I> appears in a <I>decl-specifier-seq</I>,
the <I>init-declarator-list</I> of the declaration shall not be empty.

</BLOCKQUOTE>

<P>this should apply to member declarations as well.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<OL><LI><P>Change 7.1.1 [dcl.stc] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...If a <I>storage-class-specifier</I> appears in
a <I>decl-specifier-seq</I>, there can be
no <TT>typedef</TT> specifier in the
same <I>decl-specifier-seq</I> and
the <I>init-declarator-list</I> <SPAN style="font-weight:bold;background-color:#A0FFA0">or <I>member-declarator-list</I></SPAN>
of the declaration shall not be empty (except for an
anonymous union declared <SPAN style="text-decoration:line-through;background-color:#FFA0A0">in a named namespace or in the
global namespace</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">at namespace scope</SPAN>, which
shall be declared <TT>static</TT>
(9.5 [class.union])). The <I>storage-class-specifier</I>
applies...

</BLOCKQUOTE>

<LI><P>Change 7.1.6.1 [dcl.type.cv] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...If a <I>cv-qualifier</I> appears in
a <I>decl-specifier-seq</I>, the <I>init-declarator-list</I>
<SPAN style="font-weight:bold;background-color:#A0FFA0">or <I>member-declarator-list</I></SPAN> of the
declaration shall not be empty. [<I>Note:</I>...

</BLOCKQUOTE>

</OL>

<P><B>Additional note, November, 2014:</B></P>

<P>The preceding resolution, which was advanced to "tentatively
ready" status during the review session following the November,
2014 (Urbana) meeting, introduces an apparently unintentional
conflict with 9.5 [class.union] paragraph 6 regarding
the requirements for anonymous unions in unnamed namespaces and has
been returned to "review" status to allow further discussion.</P>

<BR><BR><HR><A NAME="1710"></A><H4>1710.
  
Missing <TT>template</TT> keyword in <I>class-or-decltype</I>
</H4><B>Section: </B>10&#160; [class.derived]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-03<BR>


<P>A <I>class-or-decltype</I> is used as a <I>base-specifier</I> and
as a <I>mem-initializer-id</I> that names a base class.  It is
specified in 10 [class.derived] paragraph 1 as:</P>

<UL><I>class-or-decltype:</I>
<UL><I>nested-name-specifier<SUB>opt</SUB> class-name</I><BR>
<I>decltype-specifier</I>

</UL>

</UL>

<P>Consequently, a declaration like</P>

<PRE>
  template&lt;typename T&gt; struct D : T::template B&lt;int&gt;::template C&lt;int&gt; {};
</PRE>

<P>is ill-formed, although most implementations accept it; some actually
require the use of the <TT>template</TT> keyword, although the relevant
wording in 14.2 [temp.names] paragraph 4 only requires it in a
<I>qualified-id</I>, not in a <I>class-or-decltype</I>.  It would
probably be good to add a production like</P>

<UL><UL><I>nested-name-specifier</I> <TT>template</TT> <I>simple-template-id</I></UL></UL>

<P>to the definition of <I>class-or-decltype</I> and explicitly mention
those contexts in 14.2 [temp.names] as not requiring use of the
<TT>template</TT> keyword.</P>

<P><B>Additional note (January, 2014):</B></P>

<P>This is effectively issues <A HREF="
     cwg_active.html#314">314</A> and
<A HREF="
     cwg_active.html#343">343</A>.</P>

<P>See also <A HREF="">issue 1812.</A></P>

<P><B>Proposed resolution (February, 2014):</B></P>

<OL><LI><P>Change 9 [class] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

If a class is marked with the <I>class-virt-specifier</I> <TT>final</TT>
and it appears as
a <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><I>base-type-specifier</I></SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0"><I>class-or-decltype</I></SPAN>
in a <I>base-clause</I> (Clause 10 [class.derived]), the program is
ill-formed. Whenever a <I>class-key</I> is followed...

</BLOCKQUOTE>

<LI><P>Change the grammar in 10 [class.derived] paragraph 1 as
follows:</P></LI>

<UL><I>base-specifier:</I>
<UL><I>attribute-specifier-seq<SUB>opt</SUB> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">base-type-specifier</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">class-or-decltype</SPAN></I><BR>
<I>attribute-specifier-seq<SUB>opt</SUB></I> <TT>virtual</TT> <I>access-specifier<SUB>opt</SUB> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">base-type-specifier</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">class-or-decltype</SPAN></I><BR>
<I>attribute-specifier-seq<SUB>opt</SUB> access-specifier</I> <TT>virtual</TT><I><SUB>opt</SUB> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">base-type-specifier</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">class-or-decltype</SPAN></I>
</UL>
<I>class-or-decltype:</I>
<UL><I>nested-name-specifier<SUB>opt</SUB> class-name</I><BR>
<SPAN style="font-weight:bold;background-color:#A0FFA0"><I>nested-name-specifier</I> <TT>template</TT> <I>simple-template-id</I></SPAN><BR>
<I>decltype-specifier</I>
</UL>
<SPAN style="text-decoration:line-through;background-color:#FFA0A0"><I>base-type-specifier:</I></SPAN>
<UL><SPAN style="text-decoration:line-through;background-color:#FFA0A0"><I>class-or-decltype</I></SPAN>
</UL>
<I>access-specifier:</I>
<UL>...</UL>
</UL>

<LI><P>Delete paragraph 4 and change paragraph 5 of
14.2 [temp.names] as follows, splitting paragraph 5 into two
paragraphs and moving the example from paragraph 4 into paragraph
5:</P></LI>

<BLOCKQUOTE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">When the name of a member template specialization appears after
<TT>.</TT> or <TT>-&gt;</TT> in a <I>postfix-expression</I> or after
a <I>nested-name-specifier</I> in a <I>qualified-id</I>, and the object
expression of the <I>postfix-expression</I> is type-dependent or
the <I>nested-name-specifier</I> in the <I>qualified-id</I> refers to a
dependent type, but the name is not a member of the current instantiation
(14.6.2.1 [temp.dep.type]), the member template name must be prefixed
by the keyword <TT>template</TT>.  Otherwise the name is assumed to name a
non-template. [<I>Example:</I> ... &#8212;<I>end example</I>]</SPAN></P>

<P>A name prefixed by the keyword <TT>template</TT> shall be
a <I>template-id</I> or the name shall refer to a class template
<SPAN style="font-weight:bold;background-color:#A0FFA0">or alias template</SPAN>.  [<I>Note:</I> The keyword <TT>template</TT>
may not be applied to non-template members of class
templates. &#8212;<I>end note</I>] <SPAN style="font-weight:bold;background-color:#A0FFA0">The <I>nested-name-specifier</I>
(5.1.1 [expr.prim.general]) of</SPAN></P>

<UL><LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">a <I>class-head-name</I> (Clause 9 [class])
or <I>enum-head</I> (7.2 [dcl.enum]) (if any) or</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">a <I>qualified-id</I> in a <I>declarator-id</I>
(Clause 8 [dcl.decl]),</SPAN></P></LI>

</UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">or a <I>nested-name-specifier</I> directly contained in such a
<I>nested-name-specifier</I> (recursively), shall not be of the form</SPAN></P>

<UL><SPAN style="font-weight:bold;background-color:#A0FFA0"><I>nested-name-specifier</I> <TT>template</TT> <I>simple-template-id</I> <TT>::</TT></SPAN></UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I> That is, a <I>simple-template-id</I> shall not be
prefixed by the keyword <TT>template</TT> in these cases. &#8212;<I>end
note</I>]</SPAN></P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">The keyword <TT>template</TT> is optional in a
<I>typename-specifier</I> (14.6 [temp.res]),
<I>elaborated-type-specifier</I> (7.1.6.3 [dcl.type.elab]),
<I>using-declaration</I> (7.3.3 [namespace.udecl]), or
<I>class-or-decltype</I> (Clause 10 [class.derived]), and in
recursively directly-contained <I>nested-name-specifier</I>s thereof.
In these contexts, a <TT>&lt;</TT> token is always assumed to introduce
a <I>template-argument-list</I>. [<I>Note:</I> Thus, if the preceding
name is not a <I>template-name</I>, the program is ill-formed.
&#8212;<I>end note</I>] In other contexts, when the name of a member
template specialization appears after a <I>nested-name-specifier</I> that
denotes a dependent type, but the name is not a member of the current
instantiation, the member template name shall be prefixed by the
keyword <TT>template</TT>.  Similarly, when the name of a member
template specialization appears after <TT>.</TT> or <TT>-&gt;</TT>
in a <I>postfix-expression</I> (5.2 [expr.post]) and the
object expression of the <I>postfix-expression</I> is type-dependent,
but the name is not a member of the current instantiation
(14.6.2.1 [temp.dep.type]), the member template name shall be
prefixed by the keyword <TT>template</TT>. Otherwise, the name is
assumed to name a non-template. [<I>Example:</I></SPAN></P>

<PRE>
    <I>&lt;From original paragraph 4&gt;</I>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example]</I></SPAN> [<I>Note:</I> As is the case with
the <TT>typename</TT> prefix...</P>

</BLOCKQUOTE>

</OL>

<P>This resolution also resolves issues <A HREF="
     cwg_active.html#314">314</A>,
<A HREF="
     cwg_active.html#343">343</A>, <A HREF="
     cwg_active.html#1794">1794</A>, and
<A HREF="
     cwg_active.html#1812">1812</A>.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>Concerns have been expressed over the clarity and organization of
the proposed resolution, so the issue has been moved back to "review"
status to allow CWG to address these concerns.</P>

<BR><BR><HR><A NAME="314"></A><H4>314.
  
<TT>template</TT> in base class specifier
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Mark Mitchell
 &#160;&#160;&#160;

 <B>Date: </B>23 Aug 2001<BR>


<P>The EDG front-end accepts:</P>
<PRE>
template &lt;typename T&gt;
struct A {
  template &lt;typename U&gt;
  struct B {};
};

template &lt;typename T&gt;
struct C : public A&lt;T&gt;::template B&lt;T&gt; {
};
</PRE>
<P>It rejects this code if the base-specifier is spelled
<TT>A&lt;T&gt;::B&lt;T&gt;</TT>.</P>

<P>However, the grammar for a base-specifier does not allow the
<TT>template</TT> keyword.</P>

<P><B>Suggested resolution:</B></P>

It seems to me that a consistent approach to the solution that looks like
it will be adopted for <A HREF="
     cwg_defects.html#180">issue 180</A> (which deals
with the <TT>typename</TT> keyword in similar contexts) would be to
assume that <TT>B</TT> is a template if it is followed by a
"&lt;".  After all, an expression cannot appear in this context.

<P><B>Notes from the 4/02 meeting:</B></P>

<P>We agreed that <TT>template</TT> must be allowed in this context.
The syntax needs to be changed.  We also opened the related
<A HREF="
     cwg_active.html#343">issue 343</A>.</P>

<P><B>Additional note (August, 2010):</B></P>

<P>The same considerations apply to <I>mem-initializer-id</I>s, as noted
in <A HREF="
     cwg_closed.html#1019">issue 1019</A>.</P>

<P><B>Additional note (January, 2014):</B></P>

<P>See also <A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<BR><BR><HR><A NAME="343"></A><H4>343.
  
Make <TT>template</TT> optional in contexts that require a type
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>23 April 2002<BR>


<P>By analogy with <TT>typename</TT>, the keyword <TT>template</TT>
used to indicate that a dependent name will be a template name should
be optional in contexts where a type is required, e.g.,
base class lists.  We could also consider member and parameter
declarations.</P>

<P>This was suggested by <A HREF="
     cwg_active.html#314">issue 314</A>.</P>

<P><B>Additional note (January, 2014):</B></P>

<P>See also <A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<BR><BR><HR><A NAME="1794"></A><H4>1794.
  
<TT>template</TT> keyword and alias templates
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Jonathan Caves
 &#160;&#160;&#160;

 <B>Date: </B>2013-10-04<BR>


<P>The current wording of 14.2 [temp.names] paragraph 5 is:</P>

<BLOCKQUOTE>

A name prefixed by the keyword template shall be a <I>template-id</I> or
the name shall refer to a class template.

</BLOCKQUOTE>

<P>Presumably this should also allow <TT>template</TT> before alias
templates.  For example,</P>

<PRE>
  template&lt;template&lt;typename&gt; class Template&gt;
  struct Internal {
          template&lt;typename Arg&gt;
          using Bind = Template&lt;Arg&gt;;
  };

  template&lt;template&lt;typename&gt; class Template, typename Arg&gt;
  using Instantiate = Template&lt;Arg&gt;;

  template&lt;template&lt;typename&gt; class Template, typename Argument&gt;
  using Bind = Instantiate&lt;Internal&lt;Template&gt;::template Bind, Argument&gt;;
</PRE>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<BR><BR><HR><A NAME="1812"></A><H4>1812.
  
Omission of <TT>template</TT> in a <I>typename-specifier</I>
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-11-18<BR>


<P>According to 14.2 [temp.names] paragraph 4,</P>

<BLOCKQUOTE>

When the name of a member template specialization appears
after . or -&gt; in a <I>postfix-expression</I> or after
a <I>nested-name-specifier</I> in a <I>qualified-id</I>, and
the object expression of the <I>postfix-expression</I> is
type-dependent or the <I>nested-name-specifier</I> in
the <I>qualified-id</I> refers to a dependent type, but the
name is not a member of the current instantiation
(14.6.2.1 [temp.dep.type]), the member template name
must be prefixed by the keyword template.  Otherwise the
name is assumed to name a non-template.

</BLOCKQUOTE>

<P>This does not seem necessary in a <I>typename-specifier</I>;
a <TT>&lt;</TT> following a <I>qualified-id</I> in a
<I>typename-specifier</I> could safely be assumed to begin a
template argument list, so the <TT>template</TT> keyword should
be optional in this case.  Some implementations already do not
enforce this requirement.</P>

<P>See also <A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1710">issue 1710</A>.</P>

<BR><BR><HR><A NAME="2008"></A><H4>2008.
  
Default <I>template-argument</I>s underspecified
</H4><B>Section: </B>14.3&#160; [temp.arg]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Andrew Sutton
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-23<BR>




<P><B>Proposed resolution, November, 2014:</B></P>

<P>Add the following as a new paragraph after 14.3 [temp.arg]
paragraph 7:</P>

<BLOCKQUOTE>

<P>When the template in a <I>template-id</I> is an overloaded
function template...</P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">When a <I>simple-template-id</I> does not name a function,
a default <I>template-argument</I> is implicitly instantiated
(14.7.1 [temp.inst]) in a context that requires the value
of that default argument. [<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">  template&lt;typename T, typename U = int&gt; struct S { };
  S&lt;bool&gt;* p; //<SPAN style="font-family:Times;font-style:italic"> the type of </SPAN>p<SPAN style="font-family:Times;font-style:italic"> is </SPAN>S&lt;bool, int&gt;*</SPAN>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">The default argument for <TT>U</TT> is instantiated to form the
type <TT>S&lt;bool, int&gt;*</TT>, but the definition of that class
template specialization is not implicitly instantiated
(14.7.1 [temp.inst]); it is not used in a context that
requires a complete type. &#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>The preceding was extracted from the wording of the
<I>Concepts Lite</I> draft Technical Specification.</P>

<BR><BR><HR><A NAME="1955"></A><H4>1955.
  
<TT>#elif</TT> with invalid controlling expression
</H4><B>Section: </B>16.1&#160; [cpp.cond]
 &#160;&#160;&#160;

 <B>Status: </B>review
 &#160;&#160;&#160;

 <B>Submitter: </B>Jonathan Wakely
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-25<BR>




<P>An <TT>#elif</TT> is treated differently from an <TT>#else</TT>
followed immediately by an <TT>#if</TT>: assuming the preceding
<TT>#if</TT>'s condition was <TT>true</TT>, the condition in the
second <TT>#if</TT> need not be a valid <I>expression</I>, while
the condition in the <TT>#elif</TT> directive, though not evaluated,
still must be syntactically correct.</P>

<P><A HREF="http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_412.htm">
C DR 412</A> changes that for C; C++ should make the corresponding
change.</P>

<P><B>Proposed resolution (November, 2014):</B></P>

<P>Change 16.1 [cpp.cond] paragraph 6 as follows:</P>

<BLOCKQUOTE>

Each directive's condition is checked in order. If it
evaluates to false (zero), the group that it controls is
skipped: directives are processed only through the name that
determines the directive in order to keep track of the level
of nested conditionals; the rest of the directives'
preprocessing tokens are ignored, as are the other
preprocessing tokens in the group. Only the first group
whose control condition evaluates to true (nonzero) is
processed<SPAN style="font-weight:bold;background-color:#A0FFA0">; any following groups are skipped and their
controlling directives are processed as if they were in a
group that is skipped</SPAN>. If none of the conditions...

</BLOCKQUOTE>

<BR><BR><BR><BR><HR><A NAME="Drafting Status"></A><H3>Issues with "Drafting" Status</H3>
<HR><A NAME="1938"></A><H4>1938.
  
Should hosted/freestanding be implementation-defined?
</H4><B>Section: </B>1.4&#160; [intro.compliance]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-09<BR>


<P>Whether an implementation is hosted or freestanding is only
required to be documented by the value of
the <TT>__STDC_HOSTED__</TT> macro
(16.8 [cpp.predefined]). Should this characteristic be
classified as implementation-defined, thus requiring
documentation?</P>

<BR><BR><HR><A NAME="1343"></A><H4>1343.
  
Sequencing of non-class initialization
</H4><B>Section: </B>1.9&#160; [intro.execution]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-12<BR>




<P>The current wording does not indicate that initialization of a
non-class object is a full-expression, but presumably should do
so.</P>

<P><B>Additional note, April, 2013:</B></P>

<P>There is implementation variance in the treatment of the
following example:</P>

<PRE>
  struct A {
    A() { puts("ctor"); }
    A(const A&amp;) { puts("copy"); }
    const A&amp;get() const { return *this; }
    ~A() { puts("dtor"); }
  };
  struct B { B(A, A) {} };

  typedef A A2[2];
  A2 a = { A().get(), A().get() };
  B b = { A().get(), A().get() };
  int c = (A2{ A().get(), A().get() }, 0);
  int d = (B{ A().get(), A().get() }, 0);

  int main() {}
</PRE>



<P><B>Additional note (February, 2014):</B></P>

<P>Aggregate initialization could also involve more than one
full-expression, so the limitation above to &#8220;initialization
of a non-class object&#8221; is not correct.
</P>

<BR><BR><HR><A NAME="1949"></A><H4>1949.
  
&#8220;sequenced after&#8221; instead of &#8220;sequenced before&#8221;
</H4><B>Section: </B>1.9&#160; [intro.execution]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-18<BR>


<P>The term &#8220;sequenced after&#8221; is used in both the core and
library clauses instead of the more-correct &#8220;sequenced
before.&#8221;</P>

<BR><BR><HR><A NAME="1332"></A><H4>1332.
  
Handling of invalid universal-character-names
</H4><B>Section: </B>2.3&#160; [lex.charset]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2011-06-20<BR>


<P>According to 2.3 [lex.charset] paragraph 2,</P>

<BLOCKQUOTE>

The character designated by the universal-character-name
<TT>\UNNNNNNNN</TT> is that character whose character short name in
ISO/IEC 10646 is <TT>NNNNNNNN</TT>; the character designated by the
universal-character-name <TT>\uNNNN</TT> is that character whose
character short name in ISO/IEC 10646 is <TT>0000NNNN</TT>. If the
hexadecimal value for a universal-character-name corresponds to a
surrogate code point (in the range 0xD800-0xDFFF,
inclusive), the program is ill-formed. Additionally, if the
hexadecimal value for a universal-character-name outside the
<I>c-char-sequence</I>, <I>s-char-sequence</I>, or
<I>r-char-sequence</I> of a character or string literal corresponds to
a control character (in either of the ranges 0x00-0x1F or 0x7F-0x9F,
both inclusive) or to a character in the basic source character set,
the program is ill-formed.

</BLOCKQUOTE>

<P>It is not specified what should happen if the hexadecimal value
does not designate a Unicode code point: is that undefined behavior
or does it make the program ill-formed?</P>

<P>As an aside, a note should be added explaining why these
requirements apply to to an <I>r-char-sequence</I> when, as the
footnote at the end of the paragraph explains,</P>

<BLOCKQUOTE>

A sequence of characters resembling a universal-character-name in an
<I>r-char-sequence</I> (2.13.5 [lex.string]) does not form a
universal-character-name.

</BLOCKQUOTE>

<BR><BR><HR><A NAME="369"></A><H4>369.
  
Are <TT>new</TT>/<TT>delete</TT> identifiers or <I>preprocessing-op-or-punc</I>?
</H4><B>Section: </B>2.4&#160; [lex.pptoken]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin v. Loewis
 &#160;&#160;&#160;

 <B>Date: </B>30 July 2002<BR>


<P>2.4 [lex.pptoken] paragraph 2 specifies that there are 5
categories of tokens in phases 3 to 6. With 2.12 [lex.operators]
paragraph 1, it is unclear whether <TT>new</TT> is an <I>identifier</I> or a
<I>preprocessing-op-or-punc</I>; likewise for <TT>delete</TT>. This is
relevant to answer the question whether</P>
<PRE>
#define delete foo
</PRE>
<P>is a well-formed control-line, since that requires an identifier 
after the <TT>define</TT> token.</P>

<P>(See also <A HREF="
     cwg_active.html#189">issue 189</A>.)</P>



<BR><BR><HR><A NAME="1655"></A><H4>1655.
  
Line endings in raw string literals
</H4><B>Section: </B>2.4&#160; [lex.pptoken]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-26<BR>


<P>According to 2.4 [lex.pptoken] paragraph 3,</P>

<BLOCKQUOTE>

<P>If the input stream has been parsed into preprocessing
tokens up to a given character:</P>

<UL><LI>

<P>If the next character begins a sequence of characters that
could be the prefix and initial double quote of a raw string
literal, such as <TT>R"</TT>, the next preprocessing token shall be a
raw string literal. Between the initial and final double
quote characters of the raw string, any transformations
performed in phases 1 and 2 (trigraphs,
universal-character-names, and line splicing) are reverted;
this reversion shall apply before
any <I>d-char</I>, <I>r-char</I>, or delimiting parenthesis
is identified.</P></LI>

</UL>

</BLOCKQUOTE>

<P>However, phase 1 is defined as:</P>

<BLOCKQUOTE>

Physical source file characters are mapped, in an
implementation-defined manner, to the basic source character
set (introducing new-line characters for end-of-line
indicators) if necessary. The set of physical source file
characters accepted is implementation-defined. Trigraph
sequences (_N4140_.2.4 [lex.trigraph]) are replaced by
corresponding single-character internal representations. Any
source file character not in the basic source character set
(2.3 [lex.charset]) is replaced by the
universal-character-name that designates that character.

</BLOCKQUOTE>

<P>The reversion described in 2.4 [lex.pptoken] paragraph
3 specifically does not mention the replacement of physical
end-of-line indicators with new-line characters.  Is it intended
that, for example, a CRLF in the source of a raw string literal
is to be represented as a newline character or as the original
characters?</P>

<BR><BR><HR><A NAME="2000"></A><H4>2000.
  
<I>header-name</I> outside <TT>#include</TT> directive
</H4><B>Section: </B>2.4&#160; [lex.pptoken]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-09<BR>




<P>The &#8220;max munch&#8221; rule could be read to require the
characters <TT>&lt;int&gt;</TT> in <TT>vector&lt;int&gt;</TT> to
be parsed as a <I>header-name</I> rather than as three distinct
tokens.  2.8 [lex.header] paragraph 1 says,</P>

<BLOCKQUOTE>

Header name preprocessing tokens shall only appear within a
<TT>#include</TT> preprocessing directive
(16.2 [cpp.include]).

</BLOCKQUOTE>

<P>However, that is not sufficiently clear that <I>header-name</I>s
are only to be recognized in that context.</P>

<BR><BR><HR><A NAME="1901"></A><H4>1901.
  
<I>punctuator</I> referenced but not defined
</H4><B>Section: </B>2.6&#160; [lex.token]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-25<BR>




<P>The syntactic nonterminal <I>punctuator</I> appears in the grammar
for <I>token</I> in 2.6 [lex.token], but it is nowhere
defined.  It should be merged with <I>operator</I> and given an
appropriate list of tokens as a definition for the merged term.</P>



<BR><BR><HR><A NAME="189"></A><H4>189.
  
Definition of <I>operator</I> and <I>punctuator</I>
</H4><B>Section: </B>2.12&#160; [lex.operators]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>20 Dec 1999<BR>





<P>The nonterminals <I>operator</I> and <I>punctuator</I> in
2.6 [lex.token]
 are not defined.  There is
a definition of the nonterminal <I>operator</I> in
13.5 [over.oper]
 paragraph 1, but it is
apparent that the two nonterminals are not the same: the latter
includes keywords and multi-token operators and does not include the
nonoverloadable operators mentioned in paragraph 3.</P>

<P>There is a definition of <I>preprocessing-op-or-punc</I> in
2.12 [lex.operators]
, with the notation that</P>

<BLOCKQUOTE>
Each <I>preprocessing-op-or-punc</I> is converted to a single token in
translation phase 7 (2.1).
</BLOCKQUOTE>

However, this list doesn't distinguish between <I>operator</I>s and
<I>punctuator</I>s, it includes digraphs and keywords (can a given
<I>token</I> be both a <I>keyword</I> and an <I>operator</I> at the
same time?), etc.

<P><B>Suggested resolution:</B></P>

<BR><OL>
<LI>Change 13.5 [over.oper]
 to use the term
<I>overloadable-operator</I>.</LI>

<LI>Change 2.6 [lex.token]
 to use the term
<I>operator-token</I> instead of <I>operator</I> (since there are
operators that are keywords and operators that are composed of more
than one token).</LI>

<LI>Change 2.12 [lex.operators]
 to define
the nonterminals <I>operator-token</I> and <I>punctuator</I>.</LI>
</OL>

<P><B>Additional note (April, 2005):</B></P>

<P>The resolution for this problem should also address the fact that
<TT>sizeof</TT> and <TT>typeid</TT> (and potentially others like
<TT>decltype</TT> that may be added in the future) are described in
some places as &#8220;operators&#8221; but are not listed in
13.5 [over.oper] paragraph 3 among the operators that cannot be
overloaded.</P>

<P>(See also <A HREF="
     cwg_active.html#369">issue 369</A>.)</P>
<BR><BR><HR><A NAME="1924"></A><H4>1924.
  
Definition of &#8220;literal&#8221; and kinds of literals
</H4><B>Section: </B>2.13&#160; [lex.literal]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Saeed Amrollah Boyouki
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-12<BR>




<P>The term &#8220;literal&#8221; is used without definition except
the implicit connection with the syntactic nonterminal <I>literal</I>.
The relationships of English terms to syntactic nonterminals (such
as &#8220;integer literal&#8221; and <I>integer-literal</I>) should
be examined throughout 2.13 [lex.literal] and its subsections.</P>

<BR><BR><HR><A NAME="1656"></A><H4>1656.
  
Encoding of numerically-escaped characters
</H4><B>Section: </B>2.13.3&#160; [lex.ccon]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-30<BR>


<P>According to 2.13.3 [lex.ccon] paragraph 4,</P>

<BLOCKQUOTE>

The escape <TT>\ooo</TT> consists of the backslash followed by one, two, or
three octal digits that are taken to specify the value of the desired
character. The escape <TT>\xhhh</TT> consists of the backslash followed
by <TT>x</TT> followed by one or more hexadecimal digits that are taken to
specify the value of the desired character. There is no limit to the number
of digits in a hexadecimal sequence. A sequence of octal or hexadecimal
digits is terminated by the first character that is not an octal digit or a
hexadecimal digit, respectively. The value of a character literal is
implementation-defined if it falls outside of the implementation-defined
range defined for <TT>char</TT> (for literals with no
prefix), <TT>char16_t</TT> (for literals prefixed
by <TT>'u'</TT>), <TT>char32_t</TT> (for literals prefixed
by <TT>'U'</TT>), or <TT>wchar_t</TT> (for literals prefixed
by <TT>'L'</TT>).

</BLOCKQUOTE>

<P>It is not clearly stated whether the &#8220;desired character&#8221;
being specified reflects the source or the target encoding.  This
particularly affects UTF-8 string literals (2.13.5 [lex.string]
paragraph 7):</P>

<BLOCKQUOTE>

A string literal that begins with <TT>u8</TT>, such as <TT>u8"asdf"</TT>,
is a UTF-8 string literal and is initialized with the given characters as
encoded in UTF-8.

</BLOCKQUOTE>

<P>For example, assuming the source encoding is Latin-1, is
<TT>u8"\xff"</TT> supposed to specify a three-byte string whose
first two bytes are <TT>0xc3 0xbf</TT> (the UTF-8 encoding of
<TT>\u00ff</TT>) or a two-byte string whose first byte has the
value <TT>0xff</TT>?  (At least some current implementations assume the
latter interpretation.)</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>The second interpretation (that the escape sequence specifies the
execution-time code unit) is intended.</P>

<BR><BR><HR><A NAME="1859"></A><H4>1859.
  
UTF-16 in <TT>char16_t</TT> string literals
</H4><B>Section: </B>2.13.5&#160; [lex.string]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-12<BR>


<P>The resolution of <A HREF="
     cwg_defects.html#1802">issue 1802</A> clarified
that <TT>char16_t</TT> string literals can contain surrogate pairs, in
contrast to <TT>char16_t</TT> character literals.  However, there is
no explicit requirement that <TT>char16_t</TT> literals be encoded as
UTF-16, although that is explicitly stated for <TT>char16_t</TT>
character literals, so it's not clear what the value is required to be
in the surrogate-pair case.</P>

<BR><BR><HR><A NAME="1723"></A><H4>1723.
  
Multicharacter user-defined character literals
</H4><B>Section: </B>2.13.8&#160; [lex.ext]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-31<BR>




<P>According to 2.13.3 [lex.ccon] paragraph 1, a multicharacter
literal like <TT>'ab'</TT> is conditionally-supported and has
type <TT>int</TT>.</P>

<P>According to 2.13.8 [lex.ext] paragraph 6,</P>

<BLOCKQUOTE>

<P>If <I>L</I> is a <I>user-defined-character-literal</I>, let <I>ch</I> be
the literal without its <I>ud-suffix</I>. <I>S</I> shall contain a literal
operator (13.5.8 [over.literal]) whose only parameter has the type
of <I>ch</I> and the literal <I>L</I> is treated as a call of the form</P>

<UL><TT>operator ""</TT> <I>X</I><TT>(</TT><I>ch</I><TT>)</TT></UL>

</BLOCKQUOTE>

<P>A <I>user-defined-character-literal</I> like <TT>'ab'_foo</TT> would
thus require a literal operator</P>

<UL><TT>operator "" _foo(int)</TT></UL>

<P>However, that is not one of the signatures permitted by
13.5.8 [over.literal] paragraph 3.</P>

<P>Should multicharacter <I>user-defined-character-literal</I>s be
conditionally-supported?  If so, 13.5.8 [over.literal] paragraph 3
should be adjusted accordingly.  If not, a note in
2.13.8 [lex.ext] paragraph 6 saying explicitly that they are not
supported would be helpful.</P>

<BR><BR><HR><A NAME="1735"></A><H4>1735.
  
Out-of-range literals in <I>user-defined-literal</I>s
</H4><B>Section: </B>2.13.8&#160; [lex.ext]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-12<BR>


<P>The description of the numeric literals occurring as part of
<I>user-defined-integer-literal</I>s and
<I>user-defined-floating-literal</I>s in 2.13.8 [lex.ext] says
nothing about whether they are required to satisfy the same constraints as
literals that are not part of a <I>user-defined-literal</I>.  In
particular, because it is the spelling, not the value, of the literal
that is used for raw literal operators and literal operator templates,
there is no particular reason that they should be restricted to the
maximum values and precisions that apply to ordinary literals (and one
could imagine that this would be a good notation for allowing literals
of extended-precision types).</P>

<P>Is this relaxation of limits intended to be required, or is it a
quality-of-implementation issue?  Should something be said, either
normatively or non-normatively, about this question?</P>

<BR><BR><HR><A NAME="1529"></A><H4>1529.
  
Nomenclature for variable vs reference non-static data member
</H4><B>Section: </B>3&#160; [basic]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-24<BR>




<P>According to 3 [basic] paragraph 6,</P>

<BLOCKQUOTE>

A <I>variable</I> is introduced by the declaration of a reference other than
a non-static data member or of an object.

</BLOCKQUOTE>

<P>In other words, non-static data members of reference type are not
variables.  This complicates the wording in a number of places, where
the text refers to &#8220;variable or data member,&#8221; presumably to
cover the reference case, but that phrasing could lead to the mistaken
impression that all data members are not variables.  It would be better
if either there were a term for the current phrase &#8220;variable or
data member&#8221; or if there were a less-unwieldy term for
&#8220;non-static data member of reference type&#8221; that could be
used in place of &#8220;data member&#8221; in the current phrasing.</P>

<BR><BR><HR><A NAME="1581"></A><H4>1581.
  
When are <TT>constexpr</TT> member functions defined?
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-10-29<BR>




<P>Clause 12 [special] is perfectly clear that special
member functions are only implicitly defined when they are
odr-used. This creates a problem for constant expressions in
unevaluated contexts:</P>

<PRE>
   struct duration {
     constexpr duration() {}
     constexpr operator int() const { return 0; }
   };
   // duration d = duration(); //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
   int n = sizeof(short{duration(duration())});
</PRE>

<P>The issue here is that we are not permitted to implicitly define
<TT>constexpr duration::duration(duration&amp;&amp;)</TT> in this
program, so the expression in the initializer list is not a constant
expression (because it invokes a <TT>constexpr</TT> function which has
not been defined), so the braced initializer contains a narrowing
conversion, so the program is ill-formed.</P>

<P>If we uncomment line #1, the move constructor is implicitly defined
and the program is valid. This spooky action at a distance is
extremely unfortunate. Implementations diverge on this point.</P>

<P>There are also similar problems with implicit instantiation of
<TT>constexpr</TT> functions.  It is not clear which contexts require
their instantiation.  For example:</P>

<PRE>
  template&lt;int N&gt; struct U {};
  int g(int);
  template&lt;typename T&gt; constexpr int h(T) { return T::error; }
  template&lt;typename T&gt; auto f(T t) -&gt; U&lt;g(T()) + h(T())&gt; {}
  int f(...);
  int k = f(0);
</PRE>

<P>There are at least two different ways of modeling the current rules:</P>

<UL><LI><P><TT>constexpr</TT> function instantiation is triggered by
constant expression evaluation. In that case, the validity of the
above program depends on the order in which that evaluation
proceeds:</P></LI>

<UL><LI><P>If the LHS of the <TT>+</TT> is evaluated first, the program might
be valid, because the implementation might bail out evaluation before
triggering the ill-formed instantiation of <TT>h&lt;int&gt;</TT>.</P></LI>

<LI><P>If the RHS is evaluated first, the program is invalid, because
the instantiation fails.</P></LI>

</UL>

<LI><P><TT>constexpr</TT> function instantiation is triggered whenever
a <TT>constexpr</TT> function is referenced from an expression which
could be evaluated (note that this is not the same as being
potentially-evaluated)</P></LI>

</UL>

<P>These two approaches can be distinguished by code like this:</P>

<PRE>
  int k = sizeof(U&lt;0 &amp;&amp; h(0)&gt;);
</PRE>

<P>Under the first approach, this code is valid; under the second, it
is ill-formed.</P>

<P>A possible approach to resolving this issue would be to change the
definition of &#8220;potentially-evaluated&#8221; such that template
arguments, array bounds, and braced-init-lists (and any other
expressions which are constant evaluated) are always
potentially-evaluated, even if they appear within an unevaluated
context, and to change 14.7.1 [temp.inst] paragraph 3 to say
simply that function template specializations are implicitly
instantiated when they are odr-used.</P>

<P>A related question is whether putatively <TT>constexpr</TT>
constructors must be instantiated in order to determine whether their
class is a literal type or not.  See
<A HREF="
     cwg_defects.html#1358">issue 1358</A>.</P>

<P><U>Jason Merrill:</U></P>

<P>I'm concerned about unintended side-effects of such a large change
to &#8220;potentially-evaluated;&#8221; I would prefer something that
only affects <TT>constexpr</TT>.</P>

<P>It occurs to me that this is parallel to <A HREF="
     cwg_defects.html#1330">issue 1330</A>: just like we want to instantiate exception specifiers
for calls in unevaluated context, we also want to instantiate
<TT>constexpr</TT> functions.  I think we should define some other
term to say when there's a reference to a declaration, and then say
that the declaration is odr-used when that happens in
potentially-evaluated context.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>An additional question was raised about whether <TT>constexpr</TT>
functions should be instantiated as a result of appearing within
unevaluated subexpressions of constant expressions. For example:</P>

<PRE>
  #include &lt;type_traits&gt;

  template &lt;class T&gt; constexpr T f(T t) { return +t; }

  struct A { };

  template &lt;class T&gt;
  decltype(std::is_scalar&lt;T&gt;::value ? T::fail : f(T()))
    g() { }

  template &lt;class T&gt;
  void g(...);

  int main()
  {
    g&lt;A&gt;();
  }

</PRE>

<P>If <TT>constexpr</TT> instantiation happens during constant expression
evaluation, <TT>f&lt;A&gt;</TT> is never instantiated and the program is
well-formed.  If <TT>constexpr</TT> instantiation happens during parsing,
<TT>f&lt;A&gt;</TT> is instantiated and the program is ill-formed.</P>

<BR><BR><HR><A NAME="1849"></A><H4>1849.
  
Variable templates and the ODR
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-03<BR>


<P>The description in 3.2 [basic.def.odr] paragraph 6 of when
entities can be multiply-declared in a program does not, but should,
discuss variable templates.</P>

<BR><BR><HR><A NAME="1897"></A><H4>1897.
  
ODR vs alternative tokens
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-21<BR>




<P>According to 2.5 [lex.digraph] paragraph 2,</P>

<BLOCKQUOTE>

In all respects of the language, each alternative token behaves the same,
respectively, as its primary token, except for its spelling.

</BLOCKQUOTE>

<P>However, the primary and alternative tokens are different tokens,
which runs afoul of the ODR requirement in 3.2 [basic.def.odr]
paragraph 6 that the definitions consist of the &#8220;same
sequence of tokens.&#8221;  This wording should be amended to allow
for use of primary and alternative tokens.</P>

<BR><BR><HR><A NAME="2020"></A><H4>2020.
  
Inadequate description of odr-use of implicitly-invoked functions
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-08<BR>


<P>According to 3.2 [basic.def.odr] paragraph 3,</P>

<BLOCKQUOTE>

A function whose name appears as a potentially-evaluated
expression is odr-used if it is the unique lookup result or
the selected member of a set of overloaded functions
(3.4 [basic.lookup], 13.3 [over.match],
13.4 [over.over]), unless it is a pure virtual
function and its name is not explicitly
qualified. [<I>Note:</I> This covers calls to named
functions (5.2.2 [expr.call]), operator overloading
(Clause 13 [over]), user-defined conversions
(12.3.2 [class.conv.fct]), allocation function for
placement new (5.3.4 [expr.new]), as well as
non-default initialization (8.5 [dcl.init]). A
constructor selected to copy or move an object of class type
is odr-used even if the call is actually elided by the
implementation (12.8 [class.copy]). &#8212;<I>end
note</I>] An allocation or deallocation function for a class
is odr-used by a new expression appearing in a
potentially-evaluated expression as specified in
5.3.4 [expr.new] and 12.5 [class.free]. A
deallocation function for a class is odr-used by a delete
expression appearing in a potentially-evaluated expression
as specified in 5.3.5 [expr.delete] and
12.5 [class.free].

</BLOCKQUOTE>

<P>There are a couple of problems with this specification.  First,
contrary to the note, the names of overloaded operators, conversion
functions, etc., do not appear in potentially-evaluated expressions,
so the normative text does not make the note true.  Also, the
&#8220;as specified in&#8221; references do not cover odr-use
explicitly, only the invocation of the functions.</P>

<P>One possible way of addressing these deficiencies would be a
blanket rule like,</P>

<BLOCKQUOTE>

A function is odr-used if it is invoked by a potentially-evaluated
expression.

</BLOCKQUOTE>

<P>(The existing wording about appearing in a potentially-evaluated
expression would still be needed for non-call references.)</P>

<BR><BR><HR><A NAME="555"></A><H4>555.
  
Pseudo-destructor name lookup
</H4><B>Section: </B>3.4&#160; [basic.lookup]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Krzysztof Zelechowski
 &#160;&#160;&#160;

 <B>Date: </B>26 January 2006<BR>


<P>The Standard does not completely specify how to look up the
<I>type-name</I>(s) in a <I>pseudo-destructor-name</I> (5.2 [expr.post] paragraph 1, 5.2.4 [expr.pseudo]), and what
information it does have is incorrect and/or in the wrong place.
Consider, for instance, 3.4.5 [basic.lookup.classref] paragraphs
2-3:</P>

<BLOCKQUOTE>

<P>If the <I>id-expression</I> in a class member access (5.2.5 [expr.ref]) is an <I>unqualified-id</I>, and the type of the
object expression is of a class type <TT>C</TT> (or of pointer to a
class type <TT>C</TT>), the <I>unqualified-id</I> is looked up in the scope
of class <TT>C</TT>. If the type of the object expression is of pointer to
scalar type, the <I>unqualified-id</I> is looked up in the context of the
complete <I>postfix-expression</I>.</P>

<P>If the <I>unqualified-id</I> is <TT>~</TT><I>type-name</I>, and the
type of the object expression is of a class type <TT>C</TT> (or of
pointer to a class type <TT>C</TT>), the <I>type-name</I> is looked up
in the context of the entire <I>postfix-expression</I> and in the
scope of class <TT>C</TT>. The <I>type-name</I> shall refer to
a <I>class-name</I>. If <I>type-name</I> is found in both contexts,
the name shall refer to the same class type. If the type of the object
expression is of scalar type, the <I>type-name</I> is looked up in the
scope of the complete <I>postfix-expression</I>.</P>

</BLOCKQUOTE>

<P>There are at least three things wrong with this passage with
respect to pseudo-destructors:</P>

<OL>

<LI><P>A pseudo-destructor call (5.2.4 [expr.pseudo]) is not
a &#8220;class member access&#8221;, so the statements about scalar
types in the object expressions are vacuous: the object expression in
a class member access is required to be a class type or pointer to
class type (5.2.5 [expr.ref] paragraph 2).</P></LI>

<LI><P>On a related note, the lookup for the <I>type-name</I>(s) in a
pseudo-destructor name should not be described in a section entitled
&#8220;Class member access.&#8221;</P></LI>

<LI><P>Although the class member access object expressions are
carefully allowed to be either a class type or a pointer to a class
type, paragraph 2 mentions only a &#8220;pointer to scalar type&#8221;
(disallowing references) and paragraph 3 deals only with a
&#8220;scalar type,&#8221; presumably disallowing pointers (although
it could possibly be a very subtle way of referring to both non-class
pointers and references to scalar types at once).</P></LI>

</OL>

<P>The other point at which lookup of pseudo-destructors is
mentioned is 3.4.3 [basic.lookup.qual] paragraph 5:</P>

<BLOCKQUOTE>

If a <I>pseudo-destructor-name</I> (5.2.4 [expr.pseudo])
contains a <I>nested-name-specifier</I>, the <I>type-name</I>s are
looked up as types in the scope designated by the
<I>nested-name-specifier</I>.

</BLOCKQUOTE>

<P>Again, this specification is in the wrong location (a
<I>pseudo-destructor-name</I> is not a <I>qualified-id</I> and
thus should not be treated in the &#8220;Qualified name lookup&#8221;
section).</P>

<P>Finally, there is no place in the Standard that describes the
lookup for pseudo-destructor calls of the form
<TT>p-&gt;T::~T()</TT> and <TT>r.T::~T()</TT>, where <TT>p</TT>
and <TT>r</TT> are a pointer and reference to scalar, respectively.
To the extent that it gives any guidance at all,
3.4.5 [basic.lookup.classref] deals only with the case where the
<TT>~</TT> immediately follows the <TT>.</TT> or <TT>-&gt;</TT>, and
3.4.3 [basic.lookup.qual] deals only with the case where the
<I>pseudo-destructor-name</I> contains
a <I>nested-name-specifier</I> that designates a scope in which
names can be looked up.</P>

<P>See document J16/06-0008 = WG21 N1938 for further discussion of
this and related issues, including <A HREF="
     cwg_defects.html#244">244</A>,
<A HREF="
     cwg_defects.html#305">305</A>, <A HREF="
     cwg_active.html#399">399</A>,
and <A HREF="
     cwg_defects.html#414">414</A>.</P>

<P><B>Proposed resolution (June, 2008):</B></P>

<OL><LI><P>Add a new paragraph following 5.2 [expr.post]
paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

When a <I>postfix-expression</I> is followed by a dot <TT>.</TT> or
arrow <TT>-&gt;</TT> operator, the interpretation depends on the type
<TT>T</TT> of the expression preceding the operator. If the operator
is <TT>.</TT>, <TT>T</TT> shall be a scalar type or a complete class
type; otherwise, <TT>T</TT> shall be a pointer to a scalar type or a
pointer to a complete class type. When <TT>T</TT> is a (pointer to) a
scalar type, the <I>postfix-expression</I> to which the operator
belongs shall be a pseudo-destructor call (5.2.4 [expr.pseudo]); otherwise, it shall be a class member access
(5.2.5 [expr.ref]).

</BLOCKQUOTE>

<LI><P>Change 5.2.4 [expr.pseudo] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

<SPAN style="text-decoration:line-through;background-color:#FFA0A0">The left-hand side of the dot operator shall be of scalar type. The
left-hand side of the arrow operator shall be of pointer to scalar
type. This scalar type</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">The type of the expression preceding the dot
operator, or the type to which the expression preceding the arrow
operator points,</SPAN> is the object type...

</BLOCKQUOTE>

<LI><P>Change 5.2.5 [expr.ref] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

For the first option (dot) the type of the first expression (the
object expression) <SPAN style="text-decoration:line-through;background-color:#FFA0A0">shall be &#8220;class object&#8221; (of a
complete type)</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">is a class type</SPAN>. For the second option
(arrow) the type of the first expression (the pointer expression)
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">shall be &#8220;pointer to class object&#8221; (of a complete
type)</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">is a pointer to a class type</SPAN>. In these cases, the
<I>id-expression</I> shall name a member of the class or of one of its
base classes.

</BLOCKQUOTE>

<LI><P>Add a new paragraph following 3.4 [basic.lookup]
paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

In a <I>pseudo-destructor-name</I> that does not include a
<I>nested-name-specifier</I>, the <I>type-name</I>s are looked up as
types in the context of the complete expression.

</BLOCKQUOTE>

<LI><P>Delete the last sentence of 3.4.5 [basic.lookup.classref]
paragraph 2:</P></LI>

<BLOCKQUOTE>

If the <I>id-expression</I> in a class member access (5.2.5 [expr.ref]) is an <I>unqualified-id</I>, and the type of the object
expression is of a class type <TT>C</TT>, the
<I>unqualified-id</I> is looked up in the scope of class
<TT>C</TT>. <SPAN style="text-decoration:line-through;background-color:#FFA0A0">If the type of the object expression is of pointer to
scalar type, the <I>unqualified-id</I> is looked up in the
context of the complete <I>postfix-expression</I>.</SPAN>

</BLOCKQUOTE>

</OL>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>The proposed resolution must be updated with respect to the current
wording of the WP.</P>

<BR><BR><HR><A NAME="192"></A><H4>192.
  
Name lookup in parameters
</H4><B>Section: </B>3.4.1&#160; [basic.lookup.unqual]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Alan Nash
 &#160;&#160;&#160;

 <B>Date: </B>6 Jan 2000<BR>





<P>The description of name lookup in the
<I>parameter-declaration-clause</I> of member functions in
3.4.1 [basic.lookup.unqual]
 paragraphs 7-8 is
flawed in at least two regards.</P>

<P>First, both paragraphs 7 and 8 apply to the
<I>parameter-declaration-clause</I> of a member function definition
and give different rules for the lookup.  Paragraph 7 applies to names
"used in the definition of a class <TT>X</TT> outside of a member
function body...," which includes the
<I>parameter-declaration-clause</I> of a member function definition,
while paragraph 8 applies to names following the function's
<I>declarator-id</I> (see the proposed resolution of
<A HREF="
     cwg_defects.html#41">issue 41</A>), including the
<I>parameter-declaration-clause</I>.</P>

<P>Second, paragraph 8 appears to apply to the type names used in the
<I>parameter-declaration-clause</I> of a member function defined
inside the class definition.  That is, it appears to allow the
following code, which was not the intent of the Committee:</P>

<PRE>
    struct S {
        void f(I i) { }
        typedef int I;
    };
</PRE>

<P><B>Additional note, January, 2012:</B></P>

<P><I>brace-or-equal-initializer</I>s for non-static data members are
intended effectively as syntactic sugar for <I>mem-initializer</I>s in
constructor definitions; the lookup should be the same.</P>
<BR><BR><HR><A NAME="1906"></A><H4>1906.
  
Name lookup in member <TT>friend</TT> declaration
</H4><B>Section: </B>3.4.1&#160; [basic.lookup.unqual]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-30<BR>




<P>According to 3.4.1 [basic.lookup.unqual] paragraph 10,</P>

<BLOCKQUOTE>

In a <TT>friend</TT> declaration naming a member function, a name used in the
function declarator and not part of a <I>template-argument</I> in
the <I>declarator-id</I> is first looked up in the scope of the member
function's class (10.2 [class.member.lookup]). If it is not found, or if the
name is part of a <I>template-argument</I> in the <I>declarator-id</I>, the
look up is as described for unqualified names in the definition of the
class granting friendship.

</BLOCKQUOTE>

<P>The corresponding specification for non-<TT>friend</TT> declarations
in paragraph 8 applies the class-scope lookup only to names that
follow the <I>declarator-id</I>.  The same should be true in
<TT>friend</TT> declarations.</P>

<BR><BR><HR><A NAME="1828"></A><H4>1828.
  
<I>nested-name-specifier</I> ambiguity
</H4><B>Section: </B>3.4.3&#160; [basic.lookup.qual]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-08<BR>




<P><A HREF="
     cwg_defects.html#125">Issue 125</A> concerned an example like</P>

<PRE>
  friend A::B::C();
</PRE>

<P>which might be parsed as either</P>

<PRE>
  friend A (::B::C)();
</PRE>

<P>or</P>

<PRE>
  friend A::B (::C)();
</PRE>

<P>Its resolution attempted to make such constructs unambiguously
ill-formed by allowing any identifier, not just namespaces and types,
to appear in a <I>nested-name-specifier</I>, apparently on the
assumption that <TT>C</TT> in this case would become part of an
ill-formed <I>nested-name-specifier</I> instead of being taken as
the <I>unqualified-id</I> in a <I>qualified-id</I>.  Unfortunately,
the current specification does not implement that intent, leaving
both parses as valid possibilities.</P>

<P>A different approach might be to adjust the specification of the
lookup of names appearing in <I>nested-name-specifier</I>s from</P>

<BLOCKQUOTE>

If a <TT>::</TT> scope resolution operator in
a <I>nested-name-specifier</I> is not preceded by
a <I>decltype-specifier</I>, lookup of the name preceding
that <TT>::</TT> considers only namespaces, types, and templates
whose specializations are types.  If the name found does not
designate a namespace or a class, enumeration, or dependent
type, the program is ill-formed.

</BLOCKQUOTE>

<P>to</P>

<BLOCKQUOTE>

Lookup of an <I>identifier</I> followed by a <TT>::</TT>
scope resolution operator considers only namespaces, types, and
templates whose specializations are types.  If an <I>identifer</I>,
<I>template-id</I>, or <I>decltype-specifier</I> is followed by
a <TT>::</TT> scope resolution operator, the name shall designate
a namespace, class, enumeration, or dependent type, and shall form
part of a <I>nested-name-specifier</I>.

</BLOCKQUOTE>

<P>This approach would also remove the need for deferred lookup
for <I>template-id</I>s and thus resolve
<A HREF="
     cwg_active.html#1771">issue 1771</A>.</P>

<BR><BR><HR><A NAME="156"></A><H4>156.
  
Name lookup for conversion functions
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Derek Inglis
 &#160;&#160;&#160;

 <B>Date: </B>18 Aug 1999<BR>





<P>Paragraph 7 of
3.4.5 [basic.lookup.classref]
 says,</P>

<BLOCKQUOTE>
If the <I>id-expression</I> is a <I>conversion-function-id</I>, its
<I>conversion-type-id</I> shall denote the same
type in both the context in which the
entire <I>postfix-expression</I> occurs
and in the context of the class of the object
expression (or the class pointed to by the pointer expression).
</BLOCKQUOTE>

Does this mean that the following example is ill-formed?

<PRE>
    struct A { operator int(); } a;
    void foo() {
      typedef int T;
      a.operator T(); // 1) error T is not found in the context
		      // of the class of the object expression?
    }
</PRE>

The second bullet in paragraph 1 of 
3.4.3.1 [class.qual]
 says,

<BLOCKQUOTE>
a <I>conversion-type-id</I> of an
<I>operator-function-id</I> is looked up both
in the scope of the class and in the
context in which the entire <I>postfix-expression</I>
occurs and shall refer to the
same type in both contexts
</BLOCKQUOTE>

How about:

<PRE>
    struct A { typedef int T; operator T(); };
    struct B : A { operator T(); } b;
    void foo() {
      b.A::operator T(); // 2) error T is not found in the context
			 // of the postfix-expression?
    }
</PRE>

Is this interpretation correct?  Or was the intent for
this to be an error only if
<TT>T</TT> was found in both scopes and referred to different entities?

<P>If the intent was for these to be errors,
how do these rules apply to template
arguments?</P>

<PRE>
    template &lt;class T1&gt; struct A { operator T1(); }
    template &lt;class T2&gt; struct B : A&lt;T2&gt; {
      operator T2();
      void foo() {
	T2 a = A&lt;T2&gt;::operator T2(); // 3) error? when instantiated T2 is not
				     // found in the scope of the class
	T2 b = ((A&lt;T2&gt;*)this)-&gt;operator T2(); // 4) error when instantiated?
      }
    }
</PRE>

<P>(Note bullets 2 and 3 in paragraph 1 of
3.4.3.1 [class.qual]
 refer to
<I>postfix-expression</I>.  It would be better to use
<I>qualified-id</I> in both cases.)</P>

<P><U>Erwin Unruh</U>:
The intent was that you look in both contexts. If you find it only once,
that's the symbol. If you find it in both, both symbols must be "the same"
in some respect. (If you don't find it, its an error).</P>

<P><U>Mike Miller</U>:
What's not clear to me in these examples is whether what is
being looked up is <TT>T</TT> or <TT>int</TT>.
Clearly the <TT>T</TT> has to be
looked up somehow, but the "name" of a conversion function
clearly involves the base (non-typedefed) type, not typedefs
that might be used in a definition or reference (cf
3 [basic]
 paragraph 7 and
12.3 [class.conv]
 paragraph 5).
(This is true even for types that must be written
using typedefs because of the limited syntax in
<I>conversion-type-id</I>s &#8212; e.g., the "name" of the conversion
function in the following example</P>

<PRE>
    typedef void (*pf)();
    struct S {
	operator pf();
    };
</PRE>

is <TT>S::operator void(*)()</TT>, even though you can't write its name
directly.)

<P>My guess is that this means that in each scope you look up
the type named in the reference and form the canonical
operator name; if the name used in the reference isn't found
in one or the other scope, the canonical name constructed
from the other scope is used.  These names must be identical,
and the <I>conversion-type-id</I> in the canonical operator name must
not denote different types in the two scopes (i.e., the type
might not be found in one or the other scope, but if it's found
in both, they must be the same type).</P>

<P>I think this is all very vague in the current wording.</P>
<BR><BR><HR><A NAME="682"></A><H4>682.
  
Missing description of lookup of template aliases
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>1 March, 2008<BR>


<P>3.4.5 [basic.lookup.classref] does not mention template aliases as the
possible result of the lookup but should do so.</P>

<BR><BR><HR><A NAME="1089"></A><H4>1089.
  
Template parameters in member selections
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2010-06-29<BR>




<P>In an example like</P>

<PRE>
    template&lt;typename T&gt; void f(T p)-&gt;decltype(p.T::x);
</PRE>

<P>The <I>nested-name-specifier</I> <TT>T::</TT> looks like it refers
to the template parameter.  However, if this is instantiated with a
type like</P>

<PRE>
    struct T { int x; };
    struct S: T { };
</PRE>

<P>the reference will be ambiguous, since it is looked up in both the
context of the expression, finding the template parameter, and in the
class, finding the base class injected-class-name, and this could be
a deduction failure.  As a result, the same declaration with a
different parameter name</P>

<PRE>
    template&lt;typename U&gt; void f(U p)-&gt;decltype(p.U::x);
</PRE>

<P>is, in fact, not a redeclaration because the two can be distinguished
by SFINAE.</P>

<P>It would be better to add a new lookup rule that says that if a
name in a template definition resolves to a template parameter, that
name is not subject to further lookup at instantiation time.</P>

<BR><BR><HR><A NAME="1291"></A><H4>1291.
  
Looking up a <I>conversion-type-id</I>
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-10<BR>


<P>The Standard talks about looking up a <I>conversion-type-id</I> as if
it were an identifier (3.4.5 [basic.lookup.classref] paragraph 7), but that
is not exactly accurate.  Presumably it should talk instead about looking
up names (if any) appearing in the <I>type-specifier-seq</I> of the
<I>conversion-type-id</I>.</P>

<BR><BR><HR><A NAME="1835"></A><H4>1835.
  
Dependent member lookup before <TT>&lt;</TT>
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-17<BR>




<P>According to 3.4.5 [basic.lookup.classref] paragraph 1,</P>

<BLOCKQUOTE>

In a class member access expression
(5.2.5 [expr.ref]), if
the <TT></TT>. or <TT>-&gt;</TT> token is immediately
followed by an <I>identifier</I> followed by
a <TT>&lt;</TT>, the identifier must be looked up to
determine whether the <TT>&lt;</TT> is the beginning of a
template argument list (14.2 [temp.names]) or a
less-than operator. The identifier is first looked up in the
class of the object expression. If the identifier is not
found, it is then looked up in the context of the
entire <I>postfix-expression</I> and shall name a class
template.

</BLOCKQUOTE>

<P>Given</P>

<PRE>
   template&lt;typename T&gt; T end(T);
   template&lt;typename T&gt;
   bool Foo(T it) {
     return it-&gt;end &lt; it-&gt;end;
   }
</PRE>

<P>since <TT>it</TT> is dependent and thus <TT>end</TT> cannot
be looked up in the class of the object expression, it is looked
up in the context of the <I>postfix-expression</I>.  This lookup
finds the function template, making the expression ill-formed.</P>

<P>One possibility might be to limit the lookup to the class of
the object expression when the object expression is dependent.</P>



<BR><BR><HR><A NAME="1908"></A><H4>1908.
  
Dual destructor lookup and <I>template-id</I>s
</H4><B>Section: </B>3.4.5&#160; [basic.lookup.classref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-31<BR>




<P>According to 3.4.5 [basic.lookup.classref] paragraph 3,</P>

<BLOCKQUOTE>

If the <I>unqualified-id</I> is <TT>~</TT><I>type-name</I>,
the <I>type-name</I> is looked up in the context of the
entire <I>postfix-expression</I>.  If the type <TT>T</TT> of the object
expression is of a class type <TT>C</TT>, the <I>type-name</I> is also
looked up in the scope of class <TT>C</TT>. At least one of the lookups
shall find a name that refers to (possibly cv-qualified) <TT>T</TT>.

</BLOCKQUOTE>

<P>This would apply to an example like</P>

<PRE>
  namespace K {
    template &lt;typename T, typename U = char&gt; struct A { };
    A&lt;short&gt; *a;
  }

  template &lt;typename T&gt; using A = K::A&lt;short, T&gt;;

  int main() {
    K::a-&gt;~A&lt;char&gt;();
  }
</PRE>

<P>Current implementations, however, only apply the dual lookup when
the <I>type-name</I> is not a <I>template-id</I>.  The specification
should be changed to reflect current practice.</P>

<BR><BR><HR><A NAME="426"></A><H4>426.
  
Identically-named variables, one internally and one externally linked, allowed?
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>2 July 2003<BR>


<P>An example in
3.5 [basic.link] paragraph 6 creates two file-scope variables
with the same name,
one with internal linkage and one with external.</P>
<PRE>
  static void f();
  static int i = 0;                       //1
  void g() {
          extern void f();                // internal linkage
          int i;                          //2: i has no linkage
          {
                  extern void f();        // internal linkage
                  extern int i;           //3: external linkage
          }
  }
</PRE>
<P>Is this really what we want?
C99 has 6.2.2.7/7,
which gives undefined behavior for having an identifier appear with
internal and external linkage in the same translation unit.  C++
doesn't seem to have an equivalent.</P>

<P><B>Notes from October 2003 meeting:</B></P>

<P>We agree that this is an error.  We propose to leave the example
but change the comment to indicate that line //3 has undefined
behavior, and elsewhere add a normative rule giving such a
case undefined behavior.</P>

<P><B>Proposed resolution (October, 2005):</B></P>

<P>Change 3.5 [basic.link] paragraph 6 as indicated:</P>

<BLOCKQUOTE>

<P>...Otherwise, if no matching entity is found, the block scope entity
receives external linkage.  <SPAN style="font-weight:bold;background-color:#A0FFA0">If, within a translation unit, the same
entity is declared with both internal and external linkage, the
behavior is undefined.</SPAN></P>

<P>[<I>Example:</I></P>

<PRE>
    static void f();
    static int i = 0;            //<SPAN style="font-family:Times;font-style:italic"> 1</SPAN>
    void g () {
        extern void f ();        //<SPAN style="font-family:Times;font-style:italic"> internal linkage</SPAN>
        int i;                   //<SPAN style="font-family:Times;font-style:italic"> 2: </SPAN>i<SPAN style="font-family:Times;font-style:italic"> has no linkage</SPAN>
        {
            extern void f ();    //<SPAN style="font-family:Times;font-style:italic"> internal linkage</SPAN>
            extern int i;        //<SPAN style="font-family:Times;font-style:italic"> 3: external linkage</SPAN>
        }
    }
</PRE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">There are three objects named <TT>i</TT> in this program.  The
object with internal linkage introduced by the declaration in global
scope (line <TT>//1</TT> ), the object with automatic storage duration
and no linkage introduced by the declaration on line <TT>//2</TT>, and
the object with static storage duration and external linkage
introduced by the declaration on line <TT>//3</TT>.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">Without the
declaration at line <TT>//2</TT>, the declaration at line <TT>//3</TT>
would link with the declaration at line <TT>//1</TT>.  But because the
declaration with internal linkage is hidden, <TT>//3</TT> is given
external linkage, resulting in a linkage conflict.</SPAN> &#8212;<I>end
example</I>]</P>

</BLOCKQUOTE>

<P><B>Notes frum the April 2006 meeting:</B></P>

<P>According to 3.5 [basic.link] paragraph 9, the two
variables with linkage in the proposed example are not &#8220;the
same entity&#8221; because they do not have the same linkage.  Some other
formulation will be needed to describe the relationship between those
two variables.</P>

<P><B>Notes from the October 2006 meeting:</B></P>

<P>The CWG decided that it would be better to make a program with this
kind of linkage mismatch ill-formed instead of having undefined
behavior.</P>

<BR><BR><HR><A NAME="1839"></A><H4>1839.
  
Lookup of block-scope <TT>extern</TT> declarations
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-18<BR>




<P>According to 3.5 [basic.link] paragraph 6,</P>

<BLOCKQUOTE>

The name of a function declared in block scope and the name of a variable
declared by a block scope <TT>extern</TT> declaration have linkage. If
there is a visible declaration of an entity with linkage having the same
name and type, ignoring entities declared outside the innermost enclosing
namespace scope, the block scope declaration declares that same entity and
receives the linkage of the previous declaration. If there is more than one
such matching entity, the program is ill-formed.

</BLOCKQUOTE>

<P>It is not clear how declarations that are in the lexical scope of
the block-scope declaration but not members of the nearest enclosing
namespace (see 7.3.1 [namespace.def] paragraph 6) should be
treated.  (For example, the definition of the function in which the
block <TT>extern</TT> appears might be defined in an enclosing
namespace, with a visible declaration of the name in that namespace,
or it might be a member function of a class containing a member
function of the name being declared.)  Should such declarations be
produce an error or should the lexically-nearer declaration simply
be ignored?  There is implementation divergence on this point.</P>

<BR><BR><HR><A NAME="1884"></A><H4>1884.
  
Unclear requirements for same-named external-linkage entities
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-27<BR>




<P>According to 3.5 [basic.link] paragraph 9,</P>

<BLOCKQUOTE>

<P>Two names that are the same (Clause 3 [basic]) and that are
declared in different scopes shall denote the same variable, function,
type, enumerator, template or namespace if</P>

<UL><LI><P>both names have external linkage or else both names have
internal linkage and are declared in the same translation unit;
and</P></LI>

<LI><P>both names refer to members of the same namespace or to members, not
by inheritance, of the same class; and</P></LI>

<LI><P>when both names denote functions, the parameter-type-lists of the
functions (8.3.5 [dcl.fct]) are identical; and</P></LI>

<LI><P>when both names denote function templates, the signatures
(14.5.6.1 [temp.over.link]) are the same.</P></LI>

</UL>

</BLOCKQUOTE>

<P>This is not as clear as it should be.  The intent is that this
rule prevents declaring a name with extenal linkage to be, for instance,
a type in one translation unit and a namespace in a different translation
unit.  It has instead been read as begging the question of what it means
for two entities to be the same.  The wording should be tweaked to make
the intention clear.  Among other things, it should be clarified that
"declared in" refers to the namespace of which the name is a member, not
the lexical scope in which the declaration appears (which affects friend
declarations, block-scope <TT>extern</TT> declarations, and
<I>elaborated-type-specifier</I>s).</P>

<P>There is a similar restriction in 3.3.1 [basic.scope.declarative]
paragraph 4 dealing with declarations within a single declarative
region, while 3.5 [basic.link] paragraph 9 deals with names
that are associated via linkage.  The relationship between these
complementary requirements may need to be clarified as well.</P>

<BR><BR><HR><A NAME="2026"></A><H4>2026.
  
Zero-initialization and <TT>constexpr</TT>
</H4><B>Section: </B>3.6&#160; [basic.start]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-20<BR>




<P>According to 3.6.2 [basic.start.init] paragraph 2,</P>

<BLOCKQUOTE>

Variables with static storage duration (3.7.1 [basic.stc.static]) or
thread storage duration (3.7.2 [basic.stc.thread]) shall be
zero-initialized (8.5 [dcl.init]) before any other initialization
takes place.

</BLOCKQUOTE>

<P>Does this apply to constant initialization as well?  For example,
should the following be well-formed, relying on the presumed
zero-initialization preceding the constant initialization?</P>

<PRE>
  constexpr int i = i;
  struct s {
    constexpr s() : v(v) { }
    int v;
  };
  constexpr s s1;
</PRE>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG agreed that constant initialization should be considered as
happening instead of zero initialization in these cases, making the
declarations ill-formed.</P>

<BR><BR><HR><A NAME="1294"></A><H4>1294.
  
Side effects in dynamic/static initialization
</H4><B>Section: </B>3.6.2&#160; [basic.start.init]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-08<BR>




<P>According to 3.6.2 [basic.start.init] paragraph 3,</P>

<BLOCKQUOTE>

<P>An implementation is permitted to perform the initialization of a
non-local variable with static storage duration as a static
initialization even if such initialization is not required to be done
statically, provided that</P>

<UL>

<LI><P> the dynamic version of the initialization does not change the value
 of any other object of namespace scope prior to its initialization,
 and
</P></LI>

<LI><P>the static version of the initialization produces the same value in
the initialized variable as would be produced by the dynamic
initialization if all variables not required to be initialized
statically were initialized dynamically.
</P></LI>

</UL>

</BLOCKQUOTE>

<P>This does not consider side effects of the initialization in this
determination, only the values of namespace-scope variables.</P>



<BR><BR><HR><A NAME="1677"></A><H4>1677.
  
Constant initialization via aggregate initialization
</H4><B>Section: </B>3.6.2&#160; [basic.start.init]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2013-05-05<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#1489">issue 1489</A> added wording
regarding value initialization to 3.6.2 [basic.start.init] paragraph
2 in an attempt to clarify the status of an example like</P>

<PRE>
  int a[1000]{};
</PRE>

<P>However, this example is aggregate initialization, not value
initialization.  Also, now that we allow <I>brace-or-equal-initializer</I>s
in aggregates, this wording also needs to be updated to allow an aggregate
with constant non-static data member initializers to qualify for constant
initialization.</P>

<BR><BR><HR><A NAME="1634"></A><H4>1634.
  
Temporary storage duration
</H4><B>Section: </B>3.7&#160; [basic.stc]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-04<BR>




<P>According to 3.7 [basic.stc] paragraph 2,</P>

<BLOCKQUOTE>

Static, thread, and automatic storage durations are associated with objects
introduced by declarations (3.1 [basic.def]) and implicitly
created by the implementation (12.2 [class.temporary]).

</BLOCKQUOTE>

<P>The apparent intent of the reference to 12.2 [class.temporary] is
that a temporary whose lifetime is extended to be that of a reference with
one of those storage durations is considered also to have that storage
duration.  This interpretation is buttressed by use of the phrase &#8220;an
object with the same storage duration as the temporary&#8221; (twice) in
12.2 [class.temporary] paragraph 5.</P>

<P>There are two problems, however: first, the specification of lifetime
extension of temporaries (also in 12.2 [class.temporary] paragraph 5)
does not say anything about storage duration.  Also, nothing is said in
either of these locations about the storage duration of a temporary whose
lifetime is not extended.</P>

<P>The latter point is important because 3.8 [basic.life] makes
a distinction between the lifetime of an object and the acquisition and
release of the storage the object occupies, at least for objects with
non-trivial initialization and/or a non-trivial destructor.  The
assumption is made in 12.2 [class.temporary] and elsewhere that the
storage in which a temporary is created is no longer available for
reuse, as specified in 3.8 [basic.life], after the lifetime of
the temporary has ended, but this assumption is not explicitly stated.
One way to make that assumption explicit would be to define a storage
duration for temporaries whose lifetime is not extended.</P>

<BR><BR><HR><A NAME="1676"></A><H4>1676.
  
<TT>auto</TT> return type for allocation and deallocation functions
</H4><B>Section: </B>3.7.4.1&#160; [basic.stc.dynamic.allocation]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-05-04<BR>




<P>Do we need explicit language to forbid <TT>auto</TT> as the return type
of allocation and deallocation functions?</P>

<P>(See also <A HREF="
     cwg_defects.html#1669">issue 1669</A>.)</P>

<BR><BR><HR><A NAME="1910"></A><H4>1910.
  
&#8220;Shall&#8221; requirement applied to runtime behavior
</H4><B>Section: </B>3.7.4.1&#160; [basic.stc.dynamic.allocation]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-12<BR>




<P>According to 3.7.4.1 [basic.stc.dynamic.allocation] paragraph 3,</P>

<BLOCKQUOTE>

If an allocation function declared with a
non-throwing <I>exception-specification</I> (15.4 [except.spec])
fails to allocate storage, it shall return a null pointer. Any other
allocation function that fails to allocate storage shall indicate failure
only by throwing an exception (15.1 [except.throw]) of a type that
would match a handler (15.3 [except.handle]) of
type <TT>std::bad_alloc</TT> (18.6.2.1 [bad.alloc]).

</BLOCKQUOTE>

<P>The use of the word &#8220;shall&#8221; to constrain runtime behavior
is inappropriate, as it normally identifies cases requiring a compile-time
diagnostic.</P>

<BR><BR><HR><A NAME="2019"></A><H4>2019.
  
Member references omitted from description of storage duration
</H4><B>Section: </B>3.7.5&#160; [basic.stc.inherit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-08<BR>


<P>According to 3.7.5 [basic.stc.inherit] paragraph 1,</P>

<BLOCKQUOTE>

The storage duration of member subobjects, base class
subobjects and array elements is that of their complete
object (1.8 [intro.object]).

</BLOCKQUOTE>

<P>This wording does not cover member references, which should also
have the same storage duration as the object of which they are a
member.</P>

<BR><BR><HR><A NAME="1027"></A><H4>1027.
  
Type consistency and reallocation of scalar types
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2010-02-03<BR>




<P>Is the following well-formed?</P>

<PRE>
    int f() {
        int i = 3;
        new (&amp;i) float(1.2);
        return i;
    }
</PRE>

<P>The wording that is intended to prevent such shenanigans,
3.8 [basic.life] paragraphs 7-9, doesn't quite apply here.
In particular, paragraph 7 reads,</P>

<BLOCKQUOTE>

<P>If, after the lifetime of an object has ended and before the
storage which the object occupied is reused or released, a new
object is created at the storage location which the original
object occupied, a pointer that pointed to the original object, a
reference that referred to the original object, or the name of
the original object will automatically refer to the new object
and, once the lifetime of the new object has started, can be used
to manipulate the new object, if:</P>

<UL><LI><P>the storage for the new object exactly overlays the
storage location which the original object occupied, and</P></LI>

<LI><P>the new object is of the same type as the original object
(ignoring the top-level cv-qualifiers), and...</P></LI>

</UL>

</BLOCKQUOTE>

<P>The problem here is that this wording only applies
&#8220;<B>after</B> the lifetime of an object has ended and
<B>before</B> the storage which the object occupied is
reused;&#8221; for an object of a scalar type, its lifetime only
ends <I>when</I> the storage is reused or released (paragraph 1),
so it appears that these restrictions cannot apply to such
objects.</P>

<P>(See also issues <A HREF="
     cwg_active.html#1116">1116</A> and
<A HREF="
     cwg_defects.html#1338">1338</A>.)</P>

<P><B>Proposed resolution (August, 2010):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1116">issue 1116</A>.</P>

<BR><BR><HR><A NAME="1116"></A><H4>1116.
  
Aliasing of union members
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>US
 &#160;&#160;&#160;

 <B>Date: </B>2010-08-02<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3296.html#US27">N3092 comment
  US&#160;27<BR></A>

<P>Related to <A HREF="
     cwg_active.html#1027">issue 1027</A>, consider:</P>

<PRE>
    int f() {
      union U { double d; } u1, u2;
      (int&amp;)u1.d = 1;
      u2 = u1;
      return (int&amp;)u2.d;
    }
</PRE>

<P>Does this involve undefined behavior? 3.8 [basic.life] paragraph 4 seems to say that it's OK to clobber
<TT>u1</TT> with an <TT>int</TT> object. Then union
assignment copies the object representation, possibly
creating an <TT>int</TT> object in <TT>u2</TT> and making
the return statement well-defined. If this is well-defined,
compilers are significantly limited in the assumptions they
can make about type aliasing. On the other hand, the variant
where <TT>U</TT> has an array of <TT>unsigned char</TT>
member must be well-defined in order to support
<TT>std::aligned_storage</TT>.</P>

<P><U>Suggested resolution</U>: Clarify that this case is
undefined, but that adding an array of <TT>unsigned
char</TT> to union <TT>U</TT> would make it well-defined
&#8212; if a storage location is allocated with a particular
type, it should be undefined to create an object in that
storage if it would be undefined to access the stored value
of the object through the allocated type.</P>

<P>(See also issues <A HREF="
     cwg_active.html#1027">1027</A> and
<A HREF="
     cwg_defects.html#1338">1338</A>.)</P>

<P><B>Proposed resolution (August, 2010):</B></P>

<OL><LI><P>Change 3.8 [basic.life] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

<P>...The lifetime of an object of type <TT>T</TT> begins when
<SPAN style="font-weight:bold;background-color:#A0FFA0">storage with the proper alignment and size for type <TT>T</TT>
is obtained, and either</SPAN>:</P>

<UL><LI><SPAN style="text-decoration:line-through;background-color:#FFA0A0">storage with the proper alignment and size for type
<TT>T</TT> is obtained, and</SPAN></LI>

<LI><P>if the object has non-trivial initialization, its
initialization is complete<SPAN style="text-decoration:line-through;background-color:#FFA0A0">.</SPAN><SPAN style="font-weight:bold;background-color:#A0FFA0">, or</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">if <TT>T</TT> is trivially copyable, the object representation
of another <TT>T</TT> object is copied into the storage.</SPAN></P></LI>

</UL>

<P>The lifetime of an object of type <TT>T</TT> ends...</P>

</BLOCKQUOTE>

<LI><P>Change 3.8 [basic.life] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

<P>A program may end the lifetime of any object by reusing
the storage which the object occupies or by explicitly
calling the destructor for an object of a class type with a
non-trivial destructor.  For an object of a class type with
a non-trivial destructor, the program is not required to
call the destructor explicitly before the storage which the
object occupies is reused or released; however, if there is
no explicit call to the destructor or if a
<I>delete-expression</I> (5.3.5 [expr.delete]) is not
used to release the storage, the destructor shall not be
implicitly called and any program that depends on the side
effects produced by the destructor has undefined
behavior. <SPAN style="font-weight:bold;background-color:#A0FFA0">If a program obtains storage for an object of
a particular type <TT>A</TT> (e.g. with a variable definition or
<I>new-expression</I>) and later reuses that storage for an
object of another type <TT>B</TT> such that accessing the
stored value of the <TT>B</TT> object through a glvalue of
type <TT>A</TT> would have undefined behavior (3.10 [basic.lval]), the behavior is undefined. [<I>Example:</I>
</SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">  int i;
  (double&amp;)i = 1.0; //<SPAN style="font-family:Times;font-style:italic"> undefined behavior</SPAN>

  struct S { unsigned char alignas(double) ar[sizeof (double)]; } s;
  (double&amp;)s = 1.0; //<SPAN style="font-family:Times;font-style:italic"> OK, can access stored </SPAN>double<SPAN style="font-family:Times;font-style:italic"> through </SPAN>s<SPAN style="font-family:Times;font-style:italic"> because it has an </SPAN>unsigned char<SPAN style="font-family:Times;font-style:italic"> subobject</SPAN></SPAN>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE>

<LI><P>Change 3.10 [basic.lval] paragraph 10 as follows:</P></LI>

<BLOCKQUOTE>

If a program attempts to access the stored value of an
object through a glvalue of other than one of the following
types the behavior is undefined<SUP>52</SUP><SPAN style="font-weight:bold;background-color:#A0FFA0">:</SPAN>

<UL><LI><P>the dynamic type of the object,</P></LI>

<LI><P>a cv-qualified version of the dynamic type of the
object,</P></LI>

<LI><P>a type similar (as defined in 4.4 [conv.qual]) to the dynamic type of the object,</P></LI>

<LI><P>a type that is the signed or unsigned type
corresponding to the dynamic type of the object,</P></LI>

<LI><P>a type that is the signed or unsigned type
corresponding to a cv-qualified version of the dynamic type
of the object,</P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">a <TT>char</TT> or <TT>unsigned char</TT> type,</SPAN></P></LI>

<LI><P>an aggregate or union type that includes one of the
aforementioned types among its elements<SPAN style="font-weight:bold;background-color:#A0FFA0">, bases,</SPAN>
or non-static data members (including, recursively, an
element<SPAN style="font-weight:bold;background-color:#A0FFA0">, base,</SPAN> or non-static data member of a
subaggregate<SPAN style="font-weight:bold;background-color:#A0FFA0">, base,</SPAN> or contained
union)<SPAN style="text-decoration:line-through;background-color:#FFA0A0">,</SPAN><SPAN style="font-weight:bold;background-color:#A0FFA0">.</SPAN></P></LI>

<LI><P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">a type that is a (possibly cv-qualified) base class
type of the dynamic type of the object,</SPAN></P></LI>

<LI><P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">a <TT>char</TT> or <TT>unsigned char</TT> type.</SPAN></P></LI>

</UL>

</BLOCKQUOTE>

</OL>

<P>This resolution also resolves <A HREF="
     cwg_active.html#1027">issue 1027</A>.</P>

<P><B>Additional note (August, 2012):</B></P>

<P>Concerns have been raised 
regarding the interaction of this change with facilities like
<TT>std::aligned_storage</TT> and memory pools. Care must be taken
to achieve the proper balance between supporting type-based optimization
techniques and allowing practical storage management.</P>

<P><B>Additional note (January, 2013):</B></P>

<P>Several questions have been raised about the wording above
.  In
particular:</P>

<OL><LI><P>Since aggregates and unions cannot have base classes, why
are base classes mentioned?</P></LI>

<LI><P>Since unions can now have special member functions, is it still
valid to assume that they alias all their member types?</P></LI>

<LI><P>Shouldn't standard-layout classes also be considered and not
just aggregates?</P></LI>

</OL>

<P><B>Additional note, February, 2014:</B></P>

<P>According to 1.8 [intro.object] paragraph 1, an object (i.e., a
&#8220;region of storage&#8221;) is created by one of only three means:</P>

<BLOCKQUOTE>

An object is created by a definition (3.1 [basic.def]), by
a <I>new-expression</I> (5.3.4 [expr.new]) or by the
implementation (12.2 [class.temporary]) when needed. The properties of
an object are determined when the object is created.

</BLOCKQUOTE>

<P>This does not allow for obtaining the storage in other ways, such as
via <TT>malloc</TT>, in determining the lifetime of an object with vacuous
initialization (3.8 [basic.life] paragraph 1).</P>

<P>In addition, 3.8 [basic.life] paragraph 1 does not require
the storage obtained for an object of type <TT>T</TT> to be accessed via
an lvalue of type <TT>T</TT> in order to be considered an object of
that type. The treatment of &#8220;effective type&#8221; by C may be
helpful here.</P>

<BR><BR><HR><A NAME="1284"></A><H4>1284.
  
Should the lifetime of an array be independent of that of its elements?
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-02<BR>




<P>The note in 3.8 [basic.life] paragraph 2 reads,</P>

<BLOCKQUOTE>

[<I>Note:</I> The lifetime of an array object starts as soon as
storage with proper size and alignment is obtained, and its lifetime
ends when the storage which the array occupies is reused or released.
12.6.2 [class.base.init] describes the lifetime of base and member
subobjects.  &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>This wording reflects an earlier version of paragraph 1 that
deferred the start of an object's lifetime only for initialization of
objects of class type. The note simply emphasized the implication that
that the lifetime of a POD type or an array began immediately, even if
lifetime of an array's elements began later.</P>

<P>The decomposition of POD types removed the mention of PODs, leaving
only the array types, and when the normative text was changed to
include aggregates whose members have non-trivial initialization, the
note was overlooked.</P>

<P>It is not clear whether it would be better to update the note to
emphasize the distinction between aggregates with non-trivial
initialization and those without or to delete it entirely.</P>

<P>A possible related normative change to consider is whether the
specification of paragraph 1 is sufficiently clear with respect to
multidimensional arrays.  The current definition of &#8220;non-trivial
initialization&#8221; is:</P>

<BLOCKQUOTE>

An object is said to have non-trivial initialization if it is of a
class or aggregate type and it or one of its members is initialized by
a constructor other than a trivial default constructor.

</BLOCKQUOTE>

<P>Presumably the top-level array of an N-dimensional array whose
ultimate element type is a class type with non-trivial initialization
would also have non-trivial initialization, but it's not clear that
this wording says that.</P>

<P>A more radical change that came up in the discussion was whether the
undefined behavior resulting from an lvalue-to-rvalue conversion of an
uninitialized object in 4.1 [conv.lval] paragraph 1 would be
better dealt with as a lifetime violation instead.</P>

<BR><BR><HR><A NAME="1530"></A><H4>1530.
  
Member access in out-of-lifetime objects
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Howard Hinnant
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-26<BR>




<P>According to 3.8 [basic.life] paragraphs 5 and 6, a program
has undefined behavior if a pointer or glvalue designating an
out-of-lifetime object</P>

<BLOCKQUOTE>

is used to access a non-static data member or call a non-static member
function of the object

</BLOCKQUOTE>

<P>It is not clear what the word &#8220;access&#8221; means in this
context.  A reasonable interpretation might be using the pointer or
glvalue as the left operand of a class member access expression;
alternatively, it might mean to read or write the value of that
member, allowing a class member access expression that is used only
to form an address or bind a reference.</P>

<P>This needs to be clarified.  A relevant consideration is the
recent adoption of the resolution of <A HREF="
     cwg_defects.html#597">issue 597</A>,
which eased the former restriction on simple address manipulations
involving out-of-lifetime objects: if base-class offset calculations
are now allowed, why not non-static data member offset calculations?</P>

<P>(See also <A HREF="
     cwg_defects.html#1531">issue 1531</A> for other uses of
the term &#8220;access.&#8221;)</P>

<P><B>Additional note (January, 2013):</B></P>

<P>A related question is the meaning of the phrase
&#8220;before the constructor begins execution&#8221; in
12.7 [class.cdtor] paragraph 1 means:</P>

<BLOCKQUOTE>

For an object with a non-trivial constructor, referring to any
non-static member or base class of the object before the constructor
begins execution results in undefined behavior.

</BLOCKQUOTE>

<P>For example:</P>

<PRE>
  struct DerivedMember { ... };

  struct Base {
    Base(DerivedMember const&amp;);
  };

  struct Derived : Base {
    DerivedMember x;
    Derived() : Base(x) {}
  };

  Derived a;
</PRE>

<P>Is the reference to <TT>Derived::x</TT> in the <I>mem-initializer</I>
valid?</P>

<P><B>Additional note (March, 2013):</B></P>

<P>This clause is phrased in terms of the execution of the constructor.
However, it is possible for an aggregate to have a non-trivial default
constructor and be initialized without executing a constructor.  The
wording needs to be updated to allow for non-constructor initialization
to avoid appearing to imply undefined behavior for an example like:</P>

<PRE>
  struct X {
    std::string s;
  } x = {};
  std::string t = x.s;  //<SPAN style="font-family:Times;font-style:italic"> No constructor called for </SPAN>x<SPAN style="font-family:Times;font-style:italic">: undefined behavior?</SPAN>
</PRE>



<BR><BR><HR><A NAME="1776"></A><H4>1776.
  
Replacement of class objects containing reference members
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Finland
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-24<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#FI15">N3690 comment
  FI&#160;15<BR></A>

<p>The rules given in 3.8 [basic.life] paragraph 7 for when
an object's lifetime can be ended and a new object created in its
storage include the following restriction:</p>

<BLOCKQUOTE>

the type of the original object is not const-qualified, and, if a class
type, does not contain any non-static data member whose type is
const-qualified or a reference type

</BLOCKQUOTE>

<P>The intent of this restriction is to permit optimizers to rely upon
the original values of <TT>const</TT> and reference members in their
analysis of subsequent code.  However, this makes it difficult to
implement certain desirable functionality such as
<TT>optional&lt;T&gt;</TT>; see
<A HREF="https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/93ebFsxCjvQ/myxPG6o_9pkJ">this discussion</A>
for more details.</P>

<P>This rule should be reconsidered, at least as far as it applies to
unions.  If it is decided to keep the rule, acceptable programming
techniques for writing safe code when replacing such objects should
be outlined in a note.</P>

<P>(See also <A HREF="
     cwg_active.html#1404">issue 1404</A>, which will become
moot if the restriction is lifted.)</P>

<BR><BR><HR><A NAME="1853"></A><H4>1853.
  
Defining &#8220;allocated storage&#8221;
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jeffrey Yasskin
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-09<BR>


<P>The term &#8220;allocated storage&#8221; is used in several
places in the Standard to refer to memory in which an object may
be created (dynamic, static, or automatic storage), but it has no
formal definition.</P>

<BR><BR><HR><A NAME="1701"></A><H4>1701.
  
Array vs sequence in object representation
</H4><B>Section: </B>3.9&#160; [basic.types]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Lawrence Crowl
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-14<BR>


<P>According to 3.9 [basic.types] paragraph 4,</P>

<BLOCKQUOTE>

The object representation of an object of type <TT>T</TT> is the sequence
of <I>N</I> <TT>unsigned char</TT> objects taken up by the object of
type <TT>T</TT>, where <I>N</I> equals <TT>sizeof(T)</TT>.

</BLOCKQUOTE>

<P>However, it is not clear that a &#8220;sequence&#8221; can be indexed,
as an array can and as is required for the implementation of
<TT>memcpy</TT> and similar code.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>An additional point of concern has been raised
 as to whether it is appropriate
to refer to the constituent bytes of an object as being
&#8220;objects&#8221; themselves, along with the interaction of
this specification with copying or not copying parts of the object
representation that do not participate in the value representation
of the object (&#8220;padding&#8221; bytes).</P>

<BR><BR><HR><A NAME="2006"></A><H4>2006.
  
Cv-qualified <TT>void</TT> types
</H4><B>Section: </B>3.9.2&#160; [basic.compound]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-16<BR>




<P>According to 3.9.2 [basic.compound] paragraph 3,</P>

<BLOCKQUOTE>

The type of a pointer to <TT>void</TT> or a pointer to an object type
is called an <I>object pointer type</I>. [<I>Note:</I> A pointer to
<TT>void</TT> does not have a pointer-to-object type, however,
because <TT>void</TT> is not an object type. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>This wording excludes cv-qualified <TT>void</TT> types.  There
are other references in the Standard to &#8220;<TT>void</TT>
type&#8221; that are apparently intended to include cv-qualified
versions as well.</P>

<BR><BR><HR><A NAME="636"></A><H4>636.
  
Dynamic type of objects and aliasing
</H4><B>Section: </B>3.10&#160; [basic.lval]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>23 May 2007<BR>




<P>The aliasing rules given in 3.10 [basic.lval] paragraph
10 rely on the concept of &#8220;dynamic type.&#8221;  The problem is
that the dynamic type of an object often cannot be determined (or
even sufficiently constrained) at the point at which an optimizer
needs to be able to determine whether aliasing might occur or not.
For example, consider the function</P>

<PRE>
    void foo(int* p, double* q) {
        *p = 42;
        *q = 3.14;
    }
</PRE>

<P>An optimizer, on the basis of the existing aliasing rules, might
decide that an <TT>int*</TT> and a <TT>double*</TT> cannot
refer to the same object and reorder the assignments.  This
reordering, however, could result in undefined behavior if the
function <TT>foo</TT> is called as follows:</P>

<PRE>
   void goo() {
      union {
         int i; 
         double d;
      } t;

      t.i = 12;

      foo(&amp;t.i, &amp;t.d);

      cout &lt;&lt; t.d &lt;&lt; endl;
   };
</PRE>

<P>Here, the reference to <TT>t.d</TT> after the call to
<TT>foo</TT> will be valid only if the assignments in
<TT>foo</TT> are executed in the order in which they were
written; otherwise, the union will contain an <TT>int</TT>
object rather than a <TT>double</TT>.</P>

<P>One possibility would be to require that if such aliasing
occurs, it be done only via member names and not via
pointers.</P>

<P><B>Notes from the July, 2007 meeting:</B></P>

<P>This is the same issue as C's <A href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_236.htm">DR236</A>.
The CWG expressed a desire to address the issue the same way C99
does.  The issue also occurs in C++ when placement new is used to
end the lifetime of one object and start the lifetime of a different
object occupying the same storage.</P>

<BR><BR><HR><A NAME="1211"></A><H4>1211.
  
Misaligned lvalues
</H4><B>Section: </B>3.11&#160; [basic.align]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Svoboda
 &#160;&#160;&#160;

 <B>Date: </B>2010-10-20<BR>




<P>3.11 [basic.align] speaks of &#8220;alignment
requirements,&#8221; and 3.7.4.1 [basic.stc.dynamic.allocation] requires
the result of an allocation function to point to &#8220;suitably
aligned&#8221; storage, but there is no explicit statement of
what happens when these requirements are violated (presumably
undefined behavior).</P>

<BR><BR><HR><A NAME="1981"></A><H4>1981.
  
Implicit contextual conversions and <TT>explicit</TT>
</H4><B>Section: </B>4&#160; [conv]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-08<BR>




<P>According to 4 [conv] paragraph 5,</P>

<BLOCKQUOTE>

Certain language constructs require conversion to a value
having one of a specified set of types appropriate to the
construct. An expression <TT>e</TT> of class type <TT>E</TT>
appearing in such a context is said to be <I>contextually
implicitly converted to</I> a specified type <TT>T</TT> and
is well-formed if and only if <TT>e</TT> can be implicitly
converted to a type <TT>T</TT> that is determined as
follows: <TT>E</TT> is searched for conversion functions
whose return type is <I>cv</I> <TT>T</TT> or reference
to <I>cv</I> <TT>T</TT> such that <TT>T</TT> is allowed by
the context. There shall be exactly one such <TT>T</TT>.

</BLOCKQUOTE>

<P>This description leaves open two questions: first, can
<TT>explicit</TT> conversion functions be used for this
conversion?  Second, assuming that they cannot, is the
restriction to &#8220;exactly one such <TT>T</TT>&#8221;
enforced before or after exclusion of <TT>explicit</TT>
conversion functions?</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG felt that <TT>explicit</TT> conversion functions should
be removed from consideration before determining the set of
types for the conversion.</P>

<BR><BR><HR><A NAME="617"></A><H4>617.
  
Lvalue-to-rvalue conversions of uninitialized <TT>char</TT> objects
</H4><B>Section: </B>4.1&#160; [conv.lval]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Alan Stokes
 &#160;&#160;&#160;

 <B>Date: </B>6 February 2007<BR>




<P>According to 4.1 [conv.lval] paragraph 1, applying the
lvalue-to-rvalue conversion to any uninitialized object results in
undefined behavior.  However, character types are intended to allow
any data, including uninitialized objects and padding, to be copied
(hence the statements in 3.9.1 [basic.fundamental] paragraph 1
that &#8220;For character types, all bits of the object representation
participate in the value representation&#8221; and in
3.10 [basic.lval] paragraph 15 that <TT>char</TT> and
<TT>unsigned char</TT> types can alias any object).  The
lvalue-to-rvalue conversion should be permitted on uninitialized
objects of character type without evoking undefined behavior.</P>

<BR><BR><HR><A NAME="170"></A><H4>170.
  
Pointer-to-member conversions
</H4><B>Section: </B>4.11&#160; [conv.mem]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Stump
 &#160;&#160;&#160;

 <B>Date: </B>16 Sep 1999<BR>





<P>The descriptions of explicit
(5.2.9 [expr.static.cast]
 paragraph 9) and
implicit (4.11 [conv.mem]
 paragraph 2)
pointer-to-member conversions differ in two significant ways:</P>

<OL>
<LI>In a <TT>static_cast</TT>, a conversion in which the class in
the target pointer-to-member type is a base of the class in which
the member is declared is permitted and required to work correctly,
as long as the resulting pointer-to-member is eventually
dereferenced with an object whose dynamic type contains the
member.  That is, the class of the target pointer-to-member type
is not required to contain the member referred to by the value
being converted.  The specification of implicit pointer-to-member
conversion is silent on this question.

<P>(This situation cannot arise in an implicit pointer-to-member
conversion where the source value is something like <TT>&amp;X::f</TT>,
since you can only implicitly convert from pointer-to-base-member
to pointer-to-derived-member.  However, if the source value is
the result of an explicit "up-cast," the target type of the
conversion might still not contain the member referred to by the
source value.)</P></LI>

<LI>The target type in a <TT>static_cast</TT> is allowed to be
more cv-qualified than the source type; in an implicit conversion,
however, the cv-qualifications of the two types are required to
be identical.</LI>
</OL>

<P>The first difference seems like an oversight.  It is not clear
whether the latter difference is intentional or not.</P>

<P>(See also <A HREF="
     cwg_closed.html#794">issue 794</A>.)</P>

<BR><BR><HR><A NAME="536"></A><H4>536.
  
Problems in the description of <I>id-expression</I>s
</H4><B>Section: </B>5.1.1&#160; [expr.prim.general]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>13 October 2005<BR>


<P>There are at least a couple of problems in the description of
the various <I>id-expression</I>s in 5.1.1 [expr.prim.general]:</P>

<OL><LI><P>Paragraph 4 embodies an incorrect assumption about the
syntax of <I>qualified-id</I>s:</P>

<BLOCKQUOTE>

The operator <TT>::</TT> followed by an <I>identifier</I>, a
<I>qualified-id</I>, or an <I>operator-function-id</I> is a
<I>primary-expression</I>.

</BLOCKQUOTE>

<P>The problem here is that the <TT>::</TT> is actually part of the
syntax of <I>qualified-id</I>; consequently, &#8220;<TT>::</TT> followed by...
a <I>qualified-id</I>&#8221; could be something like
&#8220;<TT>:: ::i</TT>,&#8221; which is ill-formed.  Presumably
this should say something like, &#8220;A <I>qualified-id</I> with
no <I>nested-name-specifier</I> is a <I>primary-expression</I>.&#8221;</P>
</LI>

<LI><P>More importantly, some kinds of <I>id-expression</I>s are not
described by 5.1.1 [expr.prim.general].  The structure of this
section is that the result, type, and lvalue-ness are specified for
each of the cases it covers:</P>

<UL>
<LI><P>paragraph 4 deals with <I>qualified-id</I>s that have no
<I>nested-name-specifier</I></P></LI>

<LI><P>paragraph 7 deals with bare <I>identifier</I>s and with
<I>qualified-id</I>s containing a <I>nested-name-specifier</I>
that names a class</P></LI>

<LI><P>paragraph 8 deals with <I>qualified-id</I>s containing a
<I>nested-name-specifier</I> that names a namespace</P></LI>

</UL>

<P>This treatment leaves unspecified all the non-<I>identifier</I>
<I>unqualified-id</I>s (<I>operator-function-id</I>,
<I>conversion-function-id</I>, and <I>template-id</I>), as well as
(perhaps) &#8220;<TT>::</TT> <I>template-id</I>&#8221; (it's not clear
whether the &#8220;<TT>::</TT> followed by a <I>qualified-id</I>&#8221; case
is supposed to apply to <I>template-id</I>s or not).  Note also that the
proposed resolution of <A HREF="
     cwg_defects.html#301">issue 301</A> slightly
exacerbates this problem by removing the form
of <I>operator-function-id</I> that contains
a <I>tmeplate-argument-list</I>; as a result, references like
&#8220;<TT>::operator+&lt;X&gt;</TT>&#8221; are no longer covered in
5.1.1 [expr.prim.general].</P>
</LI>

</OL>

<BR><BR><HR><A NAME="1836"></A><H4>1836.
  
Use of class type being defined in <I>trailing-return-type</I>
</H4><B>Section: </B>5.1.1&#160; [expr.prim.general]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-17<BR>


<P>According to 5.1.1 [expr.prim.general] paragraph 3,</P>

<BLOCKQUOTE>

Unlike the object expression in other
contexts, <TT>*this</TT> is not required to be of complete
type for purposes of class member access
(5.2.5 [expr.ref]) outside the member function
body.

</BLOCKQUOTE>

<P>Is this special treatment of member access expressions intended
to apply only to <TT>*this</TT>, or does it apply to other ways of
specifying the class being defined in the object expression?  For
example,</P>

<PRE>
  struct S {
    int i;
    auto f1() -&gt; decltype((*this).i);      //<SPAN style="font-family:Times;font-style:italic"> okay</SPAN>
    auto f2(S&amp; This) -&gt; decltype(This.i);  //<SPAN style="font-family:Times;font-style:italic"> okay?</SPAN>
    auto f3() -&gt; decltype(((S*)0)-&gt;i);     //<SPAN style="font-family:Times;font-style:italic"> okay?</SPAN>
  };
</PRE>

<P>There is implementation divergence on this question.</P>

<P>If the intent is to allow object expressions other than
<TT>*this</TT> to have the current class type, this specification
should be moved from 5.1.1 [expr.prim.general] to
5.2.5 [expr.ref] paragraph 2, which is where the general
requirement for complete object expression types is found.</P>

<P>On a related point, the note immediately following the above-cited
passage is not quite correct:</P>

<BLOCKQUOTE>

[<I>Note:</I> only class members declared prior to the
declaration are visible. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>This does not apply when the member is a &#8220;member of an
unknown specialization,&#8221; per 14.6.2.1 [temp.dep.type]
paragraph 5 bullet 3 sub-bullet 1; for example,</P>

<PRE>
  template&lt;typename T&gt; struct S : T {
    auto f() -&gt; decltype(this-&gt;x);
  };
</PRE>

<P>Here <TT>x</TT> is presumed to be a member of the dependent base
<TT>T</TT> and is not &#8220;declared prior to the declaration&#8221;
that refers to it.</P>

<BR><BR><HR><A NAME="1837"></A><H4>1837.
  
Use of <TT>this</TT> in <TT>friend</TT> and local class declarations
</H4><B>Section: </B>5.1.1&#160; [expr.prim.general]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-13<BR>




<P>The description of the use of <TT>this</TT> found in
5.1.1 [expr.prim.general] paragraphs 3 and 4 allow it to appear
in the declaration of a non-static member function following the
optional <I>cv-qualifier-seq</I> and in the
<I>brace-or-equal-initializer</I> of a non-static data member; all
other uses are prohibited.  These restrictions appear to allow
questionable uses of <TT>this</TT> in several contexts. For example:</P>

<PRE>
  template &lt;typename T&gt;
  struct Fish { static const bool value = true; };

  struct Other {
    int p();
    auto q() -&gt; decltype(p()) *;
  };

  class Outer {
    //<SPAN style="font-family:Times;font-style:italic"> The following declares a member function of class </SPAN>Other.
    //<SPAN style="font-family:Times;font-style:italic"> Is </SPAN>this<SPAN style="font-family:Times;font-style:italic"> interpreted as </SPAN>Other*<SPAN style="font-family:Times;font-style:italic"> or </SPAN>Outer*<SPAN style="font-family:Times;font-style:italic">?</SPAN>
    friend auto Other::q() -&gt; decltype(this-&gt;p()) *;
    int g();
    int f() {
     extern void f(decltype(this-&gt;g()) *);
     struct Inner {
       //<SPAN style="font-family:Times;font-style:italic"> The following are all within the declaration of </SPAN>Outer::f().
       //<SPAN style="font-family:Times;font-style:italic"> Is </SPAN>this Outer*<SPAN style="font-family:Times;font-style:italic"> or </SPAN>Inner*<SPAN style="font-family:Times;font-style:italic">?</SPAN>
       static_assert(Fish&lt;decltype(this-&gt;g())&gt;::value, "");
       enum { X = Fish&lt;decltype(this-&gt;f())&gt;::value };
       struct Inner2 : Fish&lt;decltype(this-&gt;g())&gt; { };
       friend void f(decltype(this-&gt;g()) *);
       friend auto Other::q() -&gt; decltype(this-&gt;p()) *;
     };
     return 0;
    }
  };
</PRE>

<PRE>
  struct A {
   int f();
   bool b = [] {
    struct Local {
     static_assert(sizeof this-&gt;f() == sizeof(int), ""); // A<SPAN style="font-family:Times;font-style:italic"> or </SPAN>Local<SPAN style="font-family:Times;font-style:italic">?</SPAN>
    };
   };
  };
</PRE>

<P>There is implementation divergence on the treatment of these
examples.</P>

<BR><BR><HR><A NAME="1249"></A><H4>1249.
  
Cv-qualification of nested lambda capture
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-02<BR>


<P>Consider the following example:</P>

<PRE>
    void f(int i) {
      auto l1 = [i] {
        auto l2 = [&amp;i] {
          ++i;    // Well-formed?
        };
      };
    }
</PRE>

<P>Because the <TT>l1</TT> lambda is not marked as <TT>mutable</TT>,
its <TT>operator()</TT> is <TT>const</TT>; however, it is not clear from
the wording of 5.1.2 [expr.prim.lambda] paragraph 16 whether the
captured member of the enclosing lambda is considered <TT>const</TT> or
not.</P>

<BR><BR><HR><A NAME="1468"></A><H4>1468.
  
<TT>typeid</TT>, overload resolution, and implicit lambda capture
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Doug Gregor
 &#160;&#160;&#160;

 <B>Date: </B>2012-02-08<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 11, a variable is
implicitly captured if it is odr-used. In the following example,</P>

<PRE>
  struct P {
   virtual ~P();
  };

  P &amp;f(int&amp;);
  int f(const int&amp;);

  void g(int x) {
   [=] {
    typeid(f(x));
   };
  }
</PRE>

<P><TT>x</TT> is only odr-used if the operand of <TT>typeid</TT> is a
polymorphic lvalue; otherwise, the operand is unevaluated
(5.2.8 [expr.typeid] paragraphs 2-3).  Whether the operand is a
polymorphic lvalue depends on overload resolution in this case, which
depends on whether <TT>x</TT> is captured or not: if <TT>x</TT> is
captured, since the lambda is not <TT>mutable</TT>, the type of
<TT>x</TT> in the body of the lambda is <TT>const int</TT>, while if
it is not captured, it is just <TT>int</TT>.  However, the <TT>const
int</TT> version of <TT>f</TT> returns <TT>int</TT> and the
<TT>int</TT> version of <TT>f</TT> returns a polymorphic lvalue,
leading to a conundrum: <TT>x</TT> is only captured if it is not
captured, and vice versa.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The approach favored by CWG was to specify that the operand of
<TT>typeid</TT> is considered to be odr-used for the purpose of
determining capture.</P>

<BR><BR><HR><A NAME="1722"></A><H4>1722.
  
Should lambda to function pointer conversion function be <TT>noexcept</TT>?
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Ville Voutilainen
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-31<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 6,</P>

<BLOCKQUOTE>

The closure type for a non-generic <I>lambda-expression</I> with
no <I>lambda-capture</I> has a public non-virtual non-explicit const
conversion function to pointer to function with C++ language linkage
(7.5 [dcl.link]) having the same parameter and return types as
the closure type's function call operator.

</BLOCKQUOTE>

<P>This does not specify whether the conversion function is
<TT>noexcept(true)</TT> or <TT>noexcept(false)</TT>.  It might be
helpful to nail that down.</P>

<BR><BR><HR><A NAME="1913"></A><H4>1913.
  
<TT>decltype((x))</TT> in <I>lambda-expression</I>s
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Dinka Ranns
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-15<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 19,</P>

<BLOCKQUOTE>

Every occurrence of <TT>decltype((x))</TT> where <TT>x</TT> is a possibly
parenthesized <I>id-expression</I> that names an entity of automatic
storage duration is treated as if <TT>x</TT> were transformed into an
access to a corresponding data member of the closure type that would have
been declared if <TT>x</TT> were an odr-use of the denoted entity.

</BLOCKQUOTE>

<P>This formulation is problematic because it assumes that <TT>x</TT>
can be captured and, if captured, would result in a member of the
closure class.  The former is not true if the lambda has no
<I>capture-default</I>, and the latter is not guaranteed if the
<I>capture-default</I> is <TT>&amp;</TT>.</P>

<BR><BR><HR><A NAME="1937"></A><H4>1937.
  
Incomplete specification of function pointer from lambda
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-05<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 6,</P>

<BLOCKQUOTE>

The closure type for a non-generic <I>lambda-expression</I> with
no <I>lambda-capture</I> has a public non-virtual non-explicit
const conversion function to pointer to function with C ++
language linkage (7.5 [dcl.link]) having the same
parameter and return types as the closure type's function call
operator. The value returned by this conversion function shall be
the address of a function that, when invoked, has the same effect
as invoking the closure type's function call operator.

</BLOCKQUOTE>

<P>This does not mention the object for which the function call
operator would be invoked (although since there is no capture,
presumably the function call operator makes no use of the
object pointer).  This could be addressed by relating the
behavior of the function call operator to a notional temporary,
or the function call operator for such closure classes could be
made static.</P>

<BR><BR><HR><A NAME="1973"></A><H4>1973.
  
Which <I>parameter-declaration-clause</I> in a <I>lambda-expression</I>?
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Dinka Ranns
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-16<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 5,</P>

<BLOCKQUOTE>

The closure type for a non-generic <I>lambda-expression</I>
has a public inline function call operator
(13.5.4 [over.call]) whose parameters and return
type are described by
the <I>lambda-expression</I>'s <I>parameter-declaration-clause</I>
and <I>trailing-return-type</I> respectively.

</BLOCKQUOTE>

<P>This is insufficiently precise because the <I>trailing-return-type</I>
might itself contain a <I>parameter-declaration-clause</I>.  (The
same problem also occurs for generic lambdas later in the same
paragraph.)</P>

<BR><BR><HR><A NAME="1646"></A><H4>1646.
  
<I>decltype-specifier</I>s, abstract classes, and deduction failure
</H4><B>Section: </B>5.2.2&#160; [expr.call]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-28<BR>




<P>According to 5.2.2 [expr.call] paragraph 11,</P>

<BLOCKQUOTE>

<P>If a function call is a prvalue of object type:</P>

<UL><LI><P>if the function call is either</P></LI>

<UL><LI><P>the operand of a <I>decltype-specifier</I> or</P></LI>

<LI><P>the right operand of a comma operator that is the operand of
a <I>decltype-specifier</I>,</P></LI>

</UL>

<P>a temporary object is not introduced for the prvalue. The
type of the prvalue may be incomplete.  [<I>Note:</I> as a
result, storage is not allocated for the prvalue and it is
not destroyed; thus, a class type is not instantiated as a
result of being the type of a function call in this
context. This is true regardless of whether the expression
uses function call notation or operator notation
(13.3.1.2 [over.match.oper]). &#8212;<I>end note</I>]
[<I>Note:</I> unlike the rule for
a <I>decltype-specifier</I> that considers whether
an <I>id-expression</I> is parenthesized
(7.1.6.2 [dcl.type.simple]), parentheses have no special
meaning in this context. &#8212;<I>end note</I>]</P>

<LI>

<P>otherwise, the type of the prvalue shall be complete.</P></LI>

</UL>

</BLOCKQUOTE>

<P>Thus, an example like</P>

<PRE>
  template &lt;class T&gt; struct A: T { };
  template &lt;class T&gt; A&lt;T&gt; f(T) { return A&lt;T&gt;(); };
  decltype(f(42)) *p;
</PRE>

<P>is well-formed.  However, a function template specialization in
which the return type is an abstract class should be a deduction
failure, per 14.8.2 [temp.deduct] paragraph 8, last bullet:</P>

<UL><LI><P>...</P></LI>

<LI><P>Attempting to create a function type in which a parameter
type or the return type is an abstract class type
(10.4 [class.abstract]).</P></LI>

</UL>

<P>The requirement that the return type in a function call in a
<I>decltype-specifier</I> not be instantiated prevents the detection
of this deduction failure in an example like:</P>

<PRE>
  template &lt;class T&gt; struct A { virtual void f() = 0; };
  template &lt;class T&gt; A&lt;T&gt; f(T) { return A&lt;T&gt;(); };
  decltype(f(42)) *p;
</PRE>

<P>It is not clear how this should be resolved.</P>

<P>(See also <A HREF="
     cwg_active.html#1640">issue 1640</A>.)</P>

<BR><BR><HR><A NAME="1880"></A><H4>1880.
  
When are parameter objects destroyed?
</H4><B>Section: </B>5.2.2&#160; [expr.call]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-25<BR>




<P>According to 5.2.2 [expr.call] paragraph 4,</P>

<BLOCKQUOTE>

 The lifetime of a parameter ends when the function in which it is defined
 returns. The initialization and destruction of each parameter occurs
 within the context of the calling function.

</BLOCKQUOTE>

<P>This presumably means that the destruction of the parameter object
occurs before the end of the full-expression, unlike temporaries.
This is not what current implementations do, however.  It is not clear
that a change to treat parameter objects like temporaries, to match
existing practice, would be an improvement, however, as it would
result in ABI breakage for implementations that destroy parameters in
the called function.</P>

<P>See also <A HREF="
     cwg_active.html#1935">issue 1935</A> for a related
question regarding the handling of arguments to a placement
allocation function and placement deallocation function.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>WG decided to make it unspecified whether parameter objects are
destroyed immediately following the call or at the end of the
full-expression to which the call belongs.  This approach also
resolves <A HREF="
     cwg_active.html#1935">issue 1935</A>.</P>




<BR><BR><HR><A NAME="1521"></A><H4>1521.
  
<TT>T{</TT><I>expr</I><TT>}</TT> with reference types
</H4><B>Section: </B>5.2.3&#160; [expr.type.conv]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-10<BR>


<P>According to 5.2.3 [expr.type.conv] paragraph 4,</P>

<BLOCKQUOTE>

Similarly, a <I>simple-type-specifier</I> or <I>typename-specifier</I>
followed by a <I>braced-init-list</I> creates a temporary object of
the specified type direct-list-initialized (8.5.4 [dcl.init.list]) with the specified <I>braced-init-list</I>, and its
value is that temporary object as a prvalue.

</BLOCKQUOTE>

<P>This wording does not handle the case where <TT>T</TT> is a
reference type: it is not possible to create a temporary object of
that type, and presumably the result would be an xvalue, not a prvalue.</P>

<BR><BR><HR><A NAME="1893"></A><H4>1893.
  
Function-style cast with <I>braced-init-list</I>s and empty pack expansions
</H4><B>Section: </B>5.2.3&#160; [expr.type.conv]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-13<BR>


<P>[Moved to DR at the November, 2014 meeting.]</P>



<P>According to 5.2.3 [expr.type.conv] paragraph 1,</P>

<BLOCKQUOTE>

A <I>simple-type-specifier</I> (7.1.6.2 [dcl.type.simple])
or <I>typename-specifier</I> (14.6 [temp.res]) followed by a
parenthesized <I>expression-list</I> constructs a value of the specified
type given the expression list. If the expression list is a single
expression, the type conversion expression is equivalent (in definedness,
and if defined in meaning) to the corresponding cast expression
(5.4 [expr.cast]). If the type specified is a class type, the
class type shall be complete. If the expression list specifies more than a
single value, the type shall be a class with a suitably declared
constructor (8.5 [dcl.init], 12.1 [class.ctor]), and the
expression <TT>T(x1, x2, ...)</TT> is equivalent in effect to the
declaration <TT>T t(x1, x2, ...);</TT> for some invented temporary
variable <TT>t</TT>, with the result being the value of <TT>t</TT> as a
prvalue.

</BLOCKQUOTE>

<P>This does not cover the cases when the <I>expression-list</I>
contains a single <I>braced-init-list</I> (which is neither an
expression nor more than a single value) or if it contains no
expressions as the result of an empty pack expansion.</P>

<P><b>Proposed resolution (June, 2014):</b></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1299">issue 1299</A>.</P>

<BR><BR><HR><A NAME="232"></A><H4>232.
  
Is indirection through a null pointer undefined behavior?
</H4><B>Section: </B>5.3.1&#160; [expr.unary.op]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>5 Jun 2000<BR>




<P>At least a couple of places in the IS state that indirection
through a null pointer produces undefined behavior: 1.9 [intro.execution] paragraph 4 gives "dereferencing the null pointer" as an
example of undefined behavior, and 8.3.2 [dcl.ref]
paragraph 4 (in a note) uses this supposedly undefined behavior as
justification for the nonexistence of "null references."</P>

<P>However, 5.3.1 [expr.unary.op] paragraph 1, which describes
the unary "*" operator, does <I>not</I> say that the behavior is
undefined if the operand is a null pointer, as one might expect.
Furthermore, at least one passage gives dereferencing a null pointer
well-defined behavior: 5.2.8 [expr.typeid] paragraph 2
says</P>

<BLOCKQUOTE>
If the lvalue expression is obtained by applying the unary * operator
to a pointer and the pointer is a null pointer value (4.10 [conv.ptr]), the <TT>typeid</TT> expression throws the
<TT>bad_typeid</TT> exception (18.7.3 [bad.typeid]).
</BLOCKQUOTE>

<P>This is inconsistent and should be cleaned up.</P>

<P><U>Bill Gibbons</U>:</P>

<P>At one point we agreed that dereferencing a null pointer was
<I>not</I> undefined; only using the resulting value had undefined
behavior.</P>

<P>For example:</P>

<PRE>
    char *p = 0;
    char *q = &amp;*p;
</PRE>

<P>Similarly, dereferencing a pointer to the end of an array should be
allowed as long as the value is not used:</P>

<PRE>
    char a[10];
    char *b = &amp;a[10];   // equivalent to "char *b = &amp;*(a+10);"
</PRE>

<P>Both cases come up often enough in real code that they should be
allowed.</P>

<P><U>Mike Miller</U>:</P>

<P>I can see the value in this, but it doesn't seem to be well
reflected in the wording of the Standard.  For instance, presumably
<TT>*p</TT> above would have to be an lvalue in order to be the
operand of "<TT>&amp;</TT>", but the definition of "lvalue" in
3.10 [basic.lval] paragraph 2 says that "an lvalue refers to
an object."  What's the object in <TT>*p</TT>?  If we were to allow
this, we would need to augment the definition to include the result of
dereferencing null and one-past-the-end-of-array.</P>

<P><U>Tom Plum</U>:</P>

<P>Just to add one more recollection of the intent: I was <I>very</I>
happy when (I thought) we decided that it was only the attempt to
actually fetch a value that creates undefined behavior.  The words
which (I thought) were intended to clarify that are the first three
sentences of the lvalue-to-rvalue conversion, 4.1 [conv.lval]:</P>

<BLOCKQUOTE>

An lvalue (3.10 [basic.lval]) of a non-function, non-array
type <TT>T</TT> can be converted to an rvalue.  If <TT>T</TT> is an
incomplete type, a program that necessitates this conversion is
ill-formed.  If the object to which the lvalue refers is not an object
of type <TT>T</TT> and is not an object of a type derived from
<TT>T</TT>, or if the object is uninitialized, a program that
necessitates this conversion has undefined behavior.

</BLOCKQUOTE>

<P>In other words, it is only the act of "fetching", of
lvalue-to-rvalue conversion, that triggers the ill-formed or undefined
behavior.  Simply forming the lvalue expression, and then for example
taking its address, does not trigger either of those errors.  I
described this approach to WG14 and it may have been incorporated into
C 1999.</P>

<P><U>Mike Miller</U>:</P>

<P>If we admit the possibility of null lvalues, as Tom is suggesting
here, that significantly undercuts the rationale for prohibiting "null
references" -- what is a reference, after all, but a named lvalue?  If
it's okay to create a null lvalue, as long as I don't invoke the
lvalue-to-rvalue conversion on it, why shouldn't I be able to capture
that null lvalue as a reference, with the same restrictions on its
use?</P>

<P>I am not arguing in favor of null references.  I don't want them in
the language.  What I am saying is that we need to think carefully
about adopting the permissive approach of saying that it's all right
to create null lvalues, as long as you don't use them in certain ways.
If we do that, it will be very natural for people to question why they
can't pass such an lvalue to a function, as long as the function
doesn't do anything that is not permitted on a null lvalue.
</P>

<P>If we want to allow <TT>&amp;*(p=0)</TT>, maybe we should change
the definition of "<TT>&amp;</TT>" to handle dereferenced null
specially, just as <TT>typeid</TT> has special handling, rather than
changing the definition of lvalue to include dereferenced nulls, and
similarly for the array_end+1 case.  It's not as general, but I think
it might cause us fewer problems in the long run.
</P>

<P><B>Notes from the October 2003 meeting:</B></P>

<P>See also <A HREF="
     cwg_closed.html#315">issue 315</A>, which deals with
the call of a static member function through a null pointer.</P>

<P>We agreed that the approach in the standard seems okay:
<TT>p = 0; *p;</TT> is not inherently an error.  An
lvalue-to-rvalue conversion would give it undefined behavior.</P>

<P><B>Proposed resolution (October, 2004):</B></P>

<P>(Note: the resolution of <A HREF="
     cwg_active.html#453">issue 453</A>
also resolves part of this issue.)</P>

<OL>

<LI><P>Add the indicated words to 3.10 [basic.lval]
paragraph 2:</P>

<BLOCKQUOTE>

An lvalue refers to an object or function <SPAN style="font-weight:bold;background-color:#A0FFA0">or is an empty lvalue
(5.3.1 [expr.unary.op])</SPAN>.

</BLOCKQUOTE>

</LI>

<LI><P>Add the indicated words to 5.3.1 [expr.unary.op]
paragraph 1:</P>

<BLOCKQUOTE>

The unary <TT>*</TT> operator performs <I>indirection</I>: the
expression to which it is applied shall be a pointer to an object
type, or a pointer to a function type and the result is an lvalue
referring to the object or function to which the expression
points<SPAN style="font-weight:bold;background-color:#A0FFA0">, if any. If the pointer is a null pointer value
(4.10 [conv.ptr]) or points one past the last element
of an array object (5.7 [expr.add]), the result is an
<I>empty lvalue</I> and does not refer to any object or function.
An empty lvalue is not modifiable</SPAN>.  If the type of the
expression is &#8220;pointer to <TT>T</TT>,&#8221; the type of
the result is &#8220;<TT>T</TT>.&#8221; [<I>Note:</I> a pointer to an
incomplete type (other than cv void) can be dereferenced. The
lvalue thus obtained can be used in limited ways (to initialize a
reference, for example); this lvalue must not be converted to an
rvalue, see 4.1 [conv.lval].&#8212;<I>end note</I>]

</BLOCKQUOTE>

</LI>

<LI><P>Add the indicated words to 4.1 [conv.lval]
paragraph 1:</P>

<BLOCKQUOTE>

If the object to which the lvalue refers is not an object of type
<TT>T</TT> and is not an object of a type derived from
<TT>T</TT>, or if the object is uninitialized, <SPAN style="font-weight:bold;background-color:#A0FFA0">or if the
lvalue is an empty lvalue (5.3.1 [expr.unary.op]),</SPAN> a
program that necessitates this conversion has undefined behavior.

</BLOCKQUOTE>

</LI>

<LI><P>Change 1.9 [intro.execution] as indicated:</P>

<BLOCKQUOTE>

Certain other operations are described in this International
Standard as undefined (for example, the effect of <SPAN style="text-decoration:line-through;background-color:#FFA0A0">dereferencing
the null pointer</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">division by zero</SPAN>).

</BLOCKQUOTE>

</LI>

</OL>

<P><B>Note (March, 2005):</B></P> 

<P>The 10/2004 resolution interacts with the resolution of <A HREF="
     cwg_defects.html#73">issue 73</A>.  We added wording to 3.9.2 [basic.compound] paragraph 3 to the effect that a pointer containing
the address one past the end of an array is considered to &#8220;point
to&#8221; another object of the same type that might be located there.
The 10/2004 resolution now says that it would be undefined behavior to
use such a pointer to fetch the value of that object.  There is at
least the appearance of conflict here; it may be all right, but it at
needs to be discussed further.</P>

<P><B>Notes from the April, 2005 meeting:</B>
</P>

<P>The CWG agreed that there is no contradiction between this
direction and the resolution of <A HREF="
     cwg_defects.html#73">issue 73</A>.
However, &#8220;not modifiable&#8221; is a compile-time concept, while
in fact this deals with runtime values and thus should produce
undefined behavior instead.  Also, there are other contexts in which
lvalues can occur, such as the left operand of <TT>.</TT>
or <TT>.*</TT>, which should also be restricted.  Additional drafting
is required.</P>

<P>(See also <A HREF="
     cwg_defects.html#1102">issue 1102</A>.)</P>



<BR><BR><HR><A NAME="1653"></A><H4>1653.
  
Removing deprecated increment of <TT>bool</TT>
</H4><B>Section: </B>5.3.2&#160; [expr.pre.incr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

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

 <B>Date: </B>2013-04-19<BR>


<P>The preincrement (5.3.2 [expr.pre.incr]) and postincrement
(5.2.6 [expr.post.incr]) operators can be applied to operands of
type <TT>bool</TT>, setting the operand to <TT>true</TT>, but this
use is deprecated.  Can it now be removed altogether?</P>

<BR><BR><HR><A NAME="901"></A><H4>901.
  
Deleted <TT>operator delete</TT>
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>20 May, 2009<BR>


<P>It is not clear from 5.3.4 [expr.new] whether a deleted
<TT>operator delete</TT> is referenced by a <I>new-expression</I> in
which there is no initialization or in which the initialization cannot
throw an exception, rendering the program ill-formed.  (The question
also arises as to whether such a
<I>new-expression</I> constitutes a &#8220;use&#8221; of the
deallocation function in the sense of 3.2 [basic.def.odr].)</P>

<P><B>Notes from the July, 2009 meeting:</B></P>

<P>The rationale for defining a deallocation function as deleted would
presumably be to prevent such objects from being freed.  Treating the
<I>new-expression</I> as a use of such a deallocation function would
mean that such objects could not be created in the first place.  There
is already an exemption from freeing an object if &#8220;a suitable
deallocation function [cannot] be found;&#8221; a deleted deallocation
function should be treated similarly.</P>

<BR><BR><HR><A NAME="1935"></A><H4>1935.
  
Reuse of placement arguments in deallocation
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-04<BR>




<P>The description in 5.3.4 [expr.new] paragraph
23 regarding calling a deallocation function following an
exception during the initialization of an object resulting
from a placement <I>new-expression</I> says,</P>

<BLOCKQUOTE>

If a placement deallocation function is called, it is passed
the same additional arguments as were passed to the
placement allocation function, that is, the same arguments
as those specified with the <I>new-placement</I> syntax. If
the implementation is allowed to make a copy of any argument
as part of the call to the allocation function, it is
allowed to make a copy (of the same original value) as part
of the call to the deallocation function or to reuse the
copy made as part of the call to the allocation function. If
the copy is elided in one place, it need not be elided in
the other.

</BLOCKQUOTE>

<P>This seems curious, as it allows reuse of a parameter object
that presumably is destroyed immediately upon the return of the
allocation function (but see <A HREF="
     cwg_active.html#1880">issue 1880</A>
for a question about the timing of such destructions).</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>The resolution for <A HREF="
     cwg_active.html#1880">issue 1880</A> should
mostly resolve this issue.  The resolution should handle the case in
which an object can only be constructed into the parameter object
and neither copied nor moved.</P>

<BR><BR><HR><A NAME="1992"></A><H4>1992.
  
<TT>new (std::nothrow) int[N]</TT> can throw
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin Sebor
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-27<BR>




<P>According to 5.3.4 [expr.new] paragraph 7,</P>

<BLOCKQUOTE>

If the expression, after converting to <TT>std::size_t</TT>, is a
core constant expression and the expression is erroneous,
the program is ill-formed. Otherwise,
a <I>new-expression</I> with an erroneous expression does
not call an allocation function and terminates by throwing
an exception of a type that would match a handler
(15.3 [except.handle]) of type
<TT>std::bad_array_new_length</TT> (18.6.2.2 [new.badlength]).

<P>This wording makes no provision for an expression like</P>

<PRE>
  new (std::nothrow) int[N]
</PRE>

<P>which most programmers would intuitively expect not to throw
an exception under any condition.</P>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="242"></A><H4>242.
  
Interpretation of old-style casts
</H4><B>Section: </B>5.4&#160; [expr.cast]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>30 Aug 2000<BR>




<P>The meaning of an old-style cast is described in terms of
<TT>const_cast</TT>, <TT>static_cast</TT>, and
<TT>reinterpret_cast</TT> in 5.4 [expr.cast] paragraph 5.
Ignoring <TT>const_cast</TT> for the moment, it basically says that if
the conversion performed by a given old-style cast is one of those
performed by <TT>static_cast</TT>, the conversion is interpreted as if
it were a <TT>static_cast</TT>; otherwise, it's interpreted as if it
were a <TT>reinterpret_cast</TT>, if possible.  The following example
is given in illustration:</P>

<PRE>
    struct A {};
    struct I1 : A {};
    struct I2 : A {};
    struct D : I1, I2 {};
    A *foo( D *p ) {
	return (A*)( p ); // ill-formed static_cast interpretation
    }
</PRE>

<P>The obvious intent here is that a derived-to-base pointer
conversion is one of the conversions that can be performed using
<TT>static_cast</TT>, so <TT>(A*)(p)</TT> is equivalent to
<TT>static_cast&lt;A*&gt;(p)</TT>, which is ill-formed because of the
ambiguity.</P>

<P>Unfortunately, the description of <TT>static_cast</TT> in
5.2.9 [expr.static.cast] does NOT support this interpretation.
The problem is in the way 5.2.9 [expr.static.cast] lists the
kinds of casts that can be performed using <TT>static_cast</TT>.
Rather than saying something like "All standard conversions can be
performed using <TT>static_cast</TT>," it says</P>

<BLOCKQUOTE>
An expression e can be explicitly converted to a type <TT>T</TT> using
a <TT>static_cast</TT> of the form <TT>static_cast&lt;T&gt;(e)</TT> if
the declaration "<TT>T t(e);</TT>" is well-formed, for some invented
temporary variable <TT>t</TT>.
</BLOCKQUOTE>

<P>Given the declarations above, the hypothetical declaration</P>

<PRE>
    A* t(p);
</PRE>

<P>is NOT well-formed, because of the ambiguity.  Therefore the old-style
cast <TT>(A*)(p)</TT> is NOT one of the conversions that can be performed
using <TT>static_cast</TT>, and <TT>(A*)(p)</TT> is equivalent to
<TT>reinterpret_cast&lt;A*&gt;(p)</TT>, which is well-formed under
5.2.10 [expr.reinterpret.cast] paragraph 7.</P>

<P>Other situations besides ambiguity which might raise similar
questions include access violations, casting from virtual base
to derived, and casting pointers-to-members when virtual
inheritance is involved.</P>



<BR><BR><HR><A NAME="2013"></A><H4>2013.
  
Pointer subtraction in large array
</H4><B>Section: </B>5.7&#160; [expr.add]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-02<BR>




<P>The common code sequence used by most implementations for
pointer subtraction involves subtracting the pointer values
to determine the number of bytes and then shifting to scale
for the size of the array element.  This produces incorrect
results when the difference in bytes is larger than can be
represented by a <TT>ptrdiff_t</TT>.  For example, assuming
a 32-bit <TT>ptrdiff_t</TT>:</P>

<PRE>
  int *a, *b;
  a = malloc(0x21000000 * sizeof(int));
  b = a + 0x21000000;
  printf("%lx\n", (long)(b - a));
</PRE>

<P>This will typically print e1000000 instead of 21000000.</P>

<P>Getting the right answer would require using a more expensive
code sequence.  It would be better to make this undefined
behavior.</P>

<BR><BR><HR><A NAME="1857"></A><H4>1857.
  
Additional questions about bits
</H4><B>Section: </B>5.8&#160; [expr.shift]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Tony Van Eerd
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-12<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#1796">issue 1796</A> addressed
only the relationship of &#8220;bits&#8221; with the null character
value.  The values and arrangements of bits within an object are also
mentioned in other contexts; these should also be considered for
revision.  For example, 5.8 [expr.shift] paragraph 2 says,</P>

<BLOCKQUOTE>

The value of <TT>E1 &lt;&lt; E2</TT> is <TT>E1</TT>
left-shifted <TT>E2</TT> bit positions; vacated bits are zero-filled.

</BLOCKQUOTE>

<P>This appears to place constraints on the bit representation, which
(as noted in <A HREF="
     cwg_defects.html#1796">issue 1796</A>) is not accessible
to the program.  A similar statement appears in paragraph 3 for
<TT>&gt;&gt;</TT>.</P>

<P>The specification of the bitwise operations in 5.11 [expr.bit.and],
5.12 [expr.xor], and 5.13 [expr.or] uses the undefined
term &#8220;bitwise&#8221; in describing the operations, without specifying
whether it is the value or object representation that is in view.</P>

<P>Part of the resolution of this might be to define &#8220;bit&#8221;
(which is otherwise currently undefined in C++) as a value of a given
power of 2.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG decided to reformulate the description of the operations
themselves to avoid references to bits, splitting off the larger
questions of defining &#8220;bit&#8221; and the like to
<A HREF="
     cwg_active.html#1943">issue 1943</A> for further
consideration.</P>

<BR><BR><HR><A NAME="1895"></A><H4>1895.
  
Deleted conversions in conditional operator operands
</H4><B>Section: </B>5.16&#160; [expr.cond]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-17<BR>




<P>In an example like,</P>

<PRE>
  struct B;
  struct A { A(); A(B&amp;) = delete; operator B&amp;(); };
  struct B : A {} b;
  B &amp;c = true ? A() : b;
</PRE>

<P>the rules of 5.16 [expr.cond] paragraph 3 make this
ambiguous: <TT>A()</TT> can be implicitly converted to the type
&#8220;lvalue reference to <TT>B</TT>,&#8221; and <TT>b</TT> satisfies the
constraints to be converted to an <TT>A</TT> prvalue (it's of a type
derived from <TT>A</TT> and the cv-qualifiers are okay). Bullet 3 bullet 1
is clear that we do not actually try to create an <TT>A</TT> temporary
from <TT>b</TT>, so we don't notice that it invokes a deleted constructor
and rule out that conversion.</P>

<P>If the deleted conversion is in the other sense, the result is
unambiguous:</P>

<PRE>
  struct B;
  struct A { A(); A(B&amp;); operator B&amp;() = delete; };
  struct B : A {} b;
  B &amp;c = true ? A() : b;
</PRE>

<P><TT>A()</TT> can no longer be implicitly converted to the type
&#8220;lvalue reference to <TT>B</TT>&#8221;: since the declaration <TT>B
&amp;t = A();</TT> is not well formed (it invokes a deleted function),
there is no implicit conversion. So we unambiguously convert the third
operand to an <TT>A</TT> prvalue.</P>

<P>These should presumably either both be valid or both invalid.
EDG and gcc call both ambiguous.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>The wording should be changed to handle the convertibility
test more like overload resolution: the conversion "exists" if
the conversion function is declared, but is ill-formed if it
would actually be used.</P>

<BR><BR><HR><A NAME="1932"></A><H4>1932.
  
Bit-field results of conditional operators
</H4><B>Section: </B>5.16&#160; [expr.cond]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-21<BR>




<P>According to 5.16 [expr.cond] paragraph 3,</P>

<BLOCKQUOTE>

<P>if the second and third operand have different types and either has
(possibly cv-qualified) class type, or if both are glvalues of the same
value category and the same type except for cv-qualification, an attempt is
made to convert each of those operands to the type of the other. The
process for determining whether an operand expression <TT>E1</TT> of
type <TT>T1</TT> can be converted to match an operand
expression <TT>E2</TT> of type <TT>T2</TT> is defined as follows:</P>

<UL><LI><P>If E2 is an lvalue: <TT>E1</TT> can be converted to
match <TT>E2</TT> if <TT>E1</TT> can be implicitly converted (Clause
4 [conv]) to the type &#8220;lvalue reference
to <TT>T2</TT>&#8221;, subject to the constraint that in the conversion the
reference must bind directly (8.5.3 [dcl.init.ref]) to an
lvalue.</P></LI>

</UL>

</BLOCKQUOTE>

<P>If two bit-field glvalues have exactly the same scalar type, paragraph
3 does not apply (two non-class operands must differ in at least
cv-qualification).  For an example like</P>

<PRE>
  struct S {
    int i:3;
    const int j:4;
  } s;
  int k = true ? s.i : s.j;
</PRE>

<P>the condition is satisfied.  The intent is that <TT>S::i</TT> can be
converted to <TT>const int</TT> but <TT>S::j</TT> cannot be converted
to <TT>int</TT>, so the result should be a bit-field lvalue of
type <TT>const int</TT>.  However, the test for convertibility is phrased
in terms of direct reference binding, which is inapplicable to bit-fields,
resulting in neither conversion succeeding, leading to categorizing the
expression as ambiguous.</P>

<BR><BR><HR><A NAME="1542"></A><H4>1542.
  
Compound assignment of <I>braced-init-list</I>
</H4><B>Section: </B>5.18&#160; [expr.ass]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2012-08-21<BR>


<P>The specification of 5.18 [expr.ass] paragraph 9 is presumably
intended to allow use of a <I>braced-init-list</I> as the operand of a
compound assignment operator as well as a simple assignment operator,
although the normative wording does not explicitly say so.  (The example
in that paragraph does include</P>

<PRE>
  complex&lt;double&gt; z;
  z += { 1, 2 };      //<SPAN style="font-family:Times;font-style:italic"> meaning </SPAN>z.operator+=({1,2})
</PRE>

<P>for instance, which could be read to imply compound assignment
operators for scalar types as well.)</P>

<P>However, the details of how this is to be implemented are not clear.
Paragraph 7 says,</P>

<BLOCKQUOTE>

The behavior of an expression of the form <TT>E1</TT> <I>op</I>
<TT>=</TT> <TT>E2</TT> is equivalent to <TT>E1 = E1</TT> <I>op</I>
<TT>E2</TT> except that <TT>E1</TT> is evaluated only once.

</BLOCKQUOTE>

<P>Applying this pattern literally to a <I>braced-init-list</I> yields
invalid code: <TT>x&#160;+=&#160;{1}</TT> would become
<TT>x&#160;=&#160;x&#160;+&#160;{1}</TT>, which is non-syntactic.</P>

<P>Another problem is how to apply the prohibition against narrowing
conversions to a compound assignment.  For example,</P>

<PRE>
  char c;
  c += {1};
</PRE>

<P>would presumably always be a narrowing error, because after integral
promotions, the type of <TT>c+1</TT> is <TT>int</TT>.  The similar
<A HREF="
     cwg_closed.html#1078">issue 1078</A> was classified as "NAD" because
the workaround was simply to add a cast to suppress the error; however,
there is no place to put a similar cast in a compound assignment.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The incorrect description of the meaning of a compound assignment
with a <I>braced-init-list</I> should be fixed by CWG.  The question of
whether it makes sense to apply narrowing rules to such assignments
is better addressed by EWG.</P>

<BR><BR><HR><A NAME="1255"></A><H4>1255.
  
Definition problems with <TT>constexpr</TT> functions
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-08<BR>




<P>The current wording of the Standard is not sufficiently clear regarding
the interaction of class scope (which treats the bodies of member functions
as effectively appearing after the class definition is complete) and the
use of <TT>constexpr</TT> member functions within the class definition in
contexts requiring constant expressions.  For example, an array bound
cannot use a <TT>constexpr</TT> member function that relies on the
completeness of the class or on members that have not yet been declared,
but the current wording does not appear to state that.</P>

<P><B>Additional note (October, 2013):</B></P>

<P>This question also affects function return type deduction (the
<TT>auto</TT> specifier) in member functions.  For example, the following
should presumably be prohibited, but the current wording is not clear:</P>

<PRE>
  struct S {
    static auto f() {
      return 42;
    }
    auto g() -&gt; decltype(f()) {
      return f();
    }
  };
</PRE>


<BR><BR><HR><A NAME="1452"></A><H4>1452.
  
Value-initialized objects may be constants
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2011-12-24<BR>




<P>Some classes that would produce a constant when initialized by
value-initialization are not considered literal types.
For example:</P>

<PRE>
   struct A { int a; }; // non-constexpr default constructor
   struct B : A {};     // non-literal type
</PRE>

<BR><BR><HR><A NAME="1626"></A><H4>1626.
  
<TT>constexpr</TT> member functions in <I>brace-or-equal-initializer</I>s
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-19<BR>


<P>The Standard should make clear that a <TT>constexpr</TT> member
function cannot be used in a constant expression until its class is
complete.  For example:</P>

<PRE>
  template&lt;typename T&gt; struct C {
    template&lt;typename T2&gt; static constexpr bool _S_chk() {
      return false;
    }
    static const bool __value = _S_chk&lt;int&gt;();
  }; 

  C&lt;double&gt; c;
</PRE>

<P>Current implementations accept this, although they reject the
corresponding non-template case:</P>

<PRE>
  struct C {
    static constexpr bool _S_chk() { return false; }
    static const bool __value = _S_chk();
  };

  C c; 
</PRE>

<P>Presumably the template case should be handled consistently with the
non-template case.</P>



<BR><BR><HR><A NAME="2004"></A><H4>2004.
  
Unions with mutable members in constant expressions
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-16<BR>




<P>In an example like</P>

<PRE>
  union U { int a; mutable int b; };
  constexpr U u1 = {1};
  int k = (u1.b = 2);
  constexpr U u2 = u1; //<SPAN style="font-family:Times;font-style:italic"> ok!!</SPAN>
</PRE>

<P>The initialization of <TT>u2</TT> is not disqualified by
the current wording of the Standard because the copy is done
via the object representation, not formally involving an
lvalue-to-rvalue conversion.  A restriction should be added
to 5.20 [expr.const] forbidding the evaluation of a
defaulted copy/move construction/assignment on a class type
that has any variant mutable subobjects.</P>

<BR><BR><HR><A NAME="2022"></A><H4>2022.
  
Copy elision in constant expressions
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-16<BR>




<P>Consider the following example:</P>

<PRE>
  struct A {
    void *p;
    constexpr A(): p(this) {}
  };

  constexpr A a;		//<SPAN style="font-family:Times;font-style:italic"> well-formed</SPAN>
  constexpr A b = A();          //<SPAN style="font-family:Times;font-style:italic"> ?</SPAN>
</PRE>

<P>The declaration of <TT>a</TT> seems well-formed because the address
of <TT>a</TT> is constant.</P>

<P>The declaration of <TT>b</TT>, however, seems to depend on whether
copy elision is performed.  If it is, the declaration is the equivalent
of <TT>a</TT>; if not, however, this creates a temporary and initializes
<TT>p</TT> to the address of that temporary, making the initialization
non-constant and the declaration ill-formed.</P>

<P>It does not seem desirable for the well-formedness of the program
to depend on whether the implementation performs an optional copy
elision.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG decided to leave it unspecified whether copy elision is
performed in cases like this and to add a note to
12.8 [class.copy] to make clear that that outcome is
intentional.</P>

<BR><BR><HR><A NAME="1274"></A><H4>1274.
  
Common nonterminal for <I>expression</I> and <I>braced-init-list</I>
</H4><B>Section: </B>6.5.4&#160; [stmt.ranged]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-25<BR>




<P>It would be helpful to have a single grammar term for
<I>expression</I> and <I>braced-init-list</I>, which often occur
together in the text.  In particular, 6.5.4 [stmt.ranged]
paragraph 1 allows both, but the description of <TT>__RangeT</TT>
refers only to the <I>expression</I> case; such errors would be less
likely if the common term were available.</P>

<BR><BR><HR><A NAME="1523"></A><H4>1523.
  
Point of declaration in range-based <TT>for</TT>
</H4><B>Section: </B>6.5.4&#160; [stmt.ranged]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-16<BR>


<P>According to the general rule for declarations in 3.3.2 [basic.scope.pdecl]
paragraph 1,</P>

<BLOCKQUOTE>

The <I>point of declaration</I> for a name is immediately after its
complete declarator (Clause 8 [dcl.decl]) and before its
<I>initializer</I> (if any), except as noted below.

</BLOCKQUOTE>

<P>However, the rewritten expansion of the range-based <TT>for</TT>
statement in 6.5.4 [stmt.ranged] paragraph 1 contradicts
this general rule, so that the index variable is not visible in the
<I>range-init</I>:</P>

<PRE>
  for (int i : {i}) ;   //<SPAN style="font-family:Times;font-style:italic"> error: </SPAN>i<SPAN style="font-family:Times;font-style:italic"> not in scope</SPAN>
</PRE>

<P>(See also <A HREF="
     cwg_closed.html#1498">issue 1498</A> for another
question regarding the rewritten form of the range-based <TT>for</TT>.)</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>EWG is discussing <A HREF="
     cwg_closed.html#900">issue 900</A> and the
outcome of that discussion should be taken into consideration in
addressing this issue.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>The approach favored by CWG for resolving this issue is to change
the point of declaration of the variable in the <I>for-range-declaration</I>
to be after the <TT>)</TT>.</P>

<BR><BR><HR><A NAME="1680"></A><H4>1680.
  
Including <TT>&lt;initializer_list&gt;</TT> for range-based <TT>for</TT>
</H4><B>Section: </B>6.5.4&#160; [stmt.ranged]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-05-13<BR>




<P>A simple example like</P>

<PRE>
  int main() {
    int k = 0;
    for (auto x : { 1, 2, 3 })
      k += x;
    return k;
  }
</PRE>

<P>requires that the <TT>&lt;initializer_list&gt;</TT> header be
included, because the expansion of the range-based <TT>for</TT> involves
a declaration of the form</P>

<PRE>
  auto &amp;&amp;__range = { 1, 2, 3 };
</PRE>

<P>and a <I>braced-init-list</I> causes <TT>auto</TT> to be deduced
as a specialization of <TT>std::initializer_list</TT>.  This seems
unnecessary and could be eliminated by specifying that <TT>__range</TT>
has an array type for cases like this.</P>

<P>(It should be noted that EWG is considering a proposal to change
<TT>auto</TT> deduction for cases involving <I>braced-init-list</I>s,
so resolution of this issue should be coordinated with that effort.)</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>CWG felt that this issue should be resolved by using the array
variant of the range-based <TT>for</TT> implementation.</P>

<BR><BR><HR><A NAME="2017"></A><H4>2017.
  
Flowing off end is not equivalent to no-expression return
</H4><B>Section: </B>6.6.3&#160; [stmt.return]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-06<BR>


<P>According to 6.6.3 [stmt.return] paragraph 2,</P>

<BLOCKQUOTE>

Flowing off the end of a function is equivalent to a <TT>return</TT>
with no value...

</BLOCKQUOTE>

<P>This is not correct, since a <TT>return</TT> with no value is
ill-formed in a value-returning function but flowing off the end
results in undefined behavior.</P>

<BR><BR><HR><A NAME="1223"></A><H4>1223.
  
Syntactic disambiguation and <I>trailing-return-type</I>s
</H4><B>Section: </B>6.8&#160; [stmt.ambig]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2010-11-08<BR>


<P>Because the restriction that a <I>trailing-return-type</I> can
appear only in a declaration with &#8220;the single <I>type-specifier</I>
<TT>auto</TT>&#8221; (8.3.5 [dcl.fct] paragraph 2) is a
semantic, not a syntactic, restriction, it does not influence
disambiguation, which is &#8220;purely syntactic&#8221;
(6.8 [stmt.ambig] paragraph 3).  Consequently, some
previously unambiguous expressions are now ambiguous.  For example:</P>

<PRE>
struct A {
  A(int *);
  A *operator()(void);
  int B;
};
 
int *p;
typedef struct BB { int C[2]; } *B, C;
 
void foo() {
// The following line becomes invalid under C++0x:
  A (p)()-&gt;B;  // ill-formed function declaration
 
// In the following,
// - B()-&gt;C is either type-id or class member access expression
// - B()-&gt;C[1] is either type-id or subscripting expression
// N3126 subclause 8.2 [dcl.ambig.res] does not mention an ambiguity
// with these forms of expression
  A a(B ()-&gt;C);  // function declaration or object declaration
  sizeof(B ()-&gt;C[1]);  // sizeof(type-id) or sizeof on an expression
}
</PRE>

<P><B>Notes from the March, 2011 meeting:</B></P>

<P>CWG agreed that the presence of <TT>auto</TT> should be considered
in disambiguation, even though it is formally handled semantically
rather than syntactically.</P>

<BR><BR><HR><A NAME="1616"></A><H4>1616.
  
Disambiguation parsing and template parameters
</H4><B>Section: </B>6.8&#160; [stmt.ambig]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-01<BR>




<P>According to 6.8 [stmt.ambig] paragraph 3,</P>

<BLOCKQUOTE>

The disambiguation is purely syntactic; that is, the meaning of the names
occurring in such a statement, beyond whether they are <I>type-name</I>s or
not, is not generally used in or changed by the disambiguation. Class
templates are instantiated as necessary to determine if a qualified name is
a <I>type-name</I>. Disambiguation precedes parsing, and a statement
disambiguated as a declaration may be an ill-formed declaration. If, during
parsing, a name in a template parameter is bound differently than it would
be bound during a trial parse, the program is ill-formed. No diagnostic is
required. [<I>Note:</I> This can occur only when the name is declared
earlier in the declaration. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>The statement about template parameters is confusing (and not helped by
the fact that the example that follows illustrates the general rule for
declarations and does not involve any template parameters).  It is
attempting to say that a program is ill-formed if a template argument of a
class template specialization has a different value in the two parses.
With <TT>decltype</TT> this can now apply to other kinds of templates as
well, so the wording should be clarified and made more general.</P>

<BR><BR><HR><A NAME="1990"></A><H4>1990.
  
Ambiguity due to optional <I>decl-specifier-seq</I>
</H4><B>Section: </B>7&#160; [dcl.dcl]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-27<BR>




<P>In an example like</P>

<PRE>
  void f() {
    f();  //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
  }
</PRE>

<P>The statement at #1 is ambiguous and can be parsed as either
an expression or as a declaration.  The problem is the fact
that the <I>decl-specifier-seq</I> in a <I>simple-declaration</I>
is optional.</P>



<BR><BR><HR><A NAME="1872"></A><H4>1872.
  
Instantiations of <TT>constexpr</TT> templates that cannot appear in constant expressions
</H4><B>Section: </B>7.1.5&#160; [dcl.constexpr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-17<BR>




<P>According to 7.1.5 [dcl.constexpr] paragraph 6,</P>

<BLOCKQUOTE>

If the instantiated template specialization of a <TT>constexpr</TT>
function template or member function of a class template would fail to
satisfy the requirements for a <TT>constexpr</TT> function
or <TT>constexpr</TT> constructor, that specialization is still
a <TT>constexpr</TT> function or <TT>constexpr</TT> constructor, even
though a call to such a function cannot appear in a constant expression.

</BLOCKQUOTE>

<P>The restriction on appearing in a constant expression assumes the
previous wording that made such a specialization non-<TT>constexpr</TT>,
and a call to a non-<TT>constexpr</TT> function cannot appear in a
constant expression.  With the current wording, however, there is no
normative restriction against calls to such specializations.
5.20 [expr.const] should be updated to include such a
prohibition.</P>

<BR><BR><HR><A NAME="1348"></A><H4>1348.
  
Use of <TT>auto</TT> in a <I>trailing-return-type</I>
</H4><B>Section: </B>7.1.6.4&#160; [dcl.spec.auto]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-16<BR>




<P>It is not clear whether the <TT>auto</TT> specifier can appear
in a <I>trailing-return-type</I>.</P>

<BR><BR><HR><A NAME="1670"></A><H4>1670.
  
<TT>auto</TT> as <I>conversion-type-id</I>
</H4><B>Section: </B>7.1.6.4&#160; [dcl.spec.auto]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-26<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#FI4">N3690 comment
  FI&#160;4<BR></A>



<P>The current wording allows something like</P>

<PRE>
  struct S {
    operator auto() { return 0; }
  } s;
</PRE>

<P>If it is intended to be permitted, the details of its handling
are not clear.  Also, a similar syntax has been discussed as a
possible future extension for dealing with proxy types in deduction
which, if adopted, could cause confusion.</P>

<P><B>Additional note, November, 2013:</B></P>

<P>Doubt was expressed during the 2013-11-25 drafting review
teleconference as to the usefulness of this provision.  It is therefore
being left open for further consideration after C++14 is finalized.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG continued to express doubt as to the usefulness of this construct
but felt that if it is permitted, the rules need
clarification.</P>

<BR><BR><HR><A NAME="1868"></A><H4>1868.
  
Meaning of &#8220;placeholder type&#8221;
</H4><B>Section: </B>7.1.6.4&#160; [dcl.spec.auto]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Dawn Perchik
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>




<P>7.1.6 [dcl.type] paragraph 2 describes the <TT>auto</TT>
specifier as &#8220;a placeholder for a type to be deduced.&#8221;
Elsewhere, the Standard refers to the type represented by the
<TT>auto</TT> specifier as a &#8220;placeholder type.&#8221;  This
usage has been deemed confusing by some, requiring either a definition
of one or both terms or rewording to avoid them.</P>

<BR><BR><HR><A NAME="1485"></A><H4>1485.
  
Out-of-class definition of member unscoped opaque enumeration
</H4><B>Section: </B>7.2&#160; [dcl.enum]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-03-26<BR>




<P>The scope in which the names of enumerators are entered for
a member unscoped opaque enumeration is not clear.  According to
7.2 [dcl.enum] paragraph 10,</P>

<BLOCKQUOTE>

Each <I>enum-name</I> and each unscoped enumerator is declared in the
scope that immediately contains the <I>enum-specifier</I>.

</BLOCKQUOTE>

<P>In the case of a member opaque enumeration defined outside its
containing class, however, it is not clear whether the enumerator
names are declared in the class scope or in the lexical scope
containing the definition. Declaring them in the class scope would
be a violation of 9.2 [class.mem] paragraph 1:</P>

<BLOCKQUOTE>

The <I>member-specification</I> in a class definition declares the
full set of members of the class; no member can be added elsewhere.

</BLOCKQUOTE>

<P>Declaring the names in the lexical scope containing the
definition would be contrary to the example in
14.5.1.4 [temp.mem.enum] paragraph 1:</P>

<PRE>
  template&lt;class T&gt; struct A {
    enum E : T;
  };
  A&lt;int&gt; a;
  template&lt;class T&gt; enum A&lt;T&gt;::E : T { e1, e2 };
  A&lt;int&gt;::E e = A&lt;int&gt;::e1;
</PRE>

<P>There also appear to be problems with the rules for dependent
types and members of the current instantiation.</P>

<BR><BR><HR><A NAME="1636"></A><H4>1636.
  
Bits required for negative enumerator values
</H4><B>Section: </B>7.2&#160; [dcl.enum]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hyman Rosen
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-07<BR>


<P>According to 7.2 [dcl.enum] paragraph 7,</P>

<BLOCKQUOTE>

For an enumeration whose underlying type is fixed, the values of the
enumeration are the values of the underlying type.  Otherwise,
for an enumeration where <I>e<SUB>min</SUB></I> is the smallest
enumerator and <I>e<SUB>max</SUB></I> is the largest, the values of
the enumeration are the values in the range <I>b<SUB>min</SUB></I> to
<I>b<SUB>max</SUB></I>, defined as follows: Let <I>K</I> be 1 for a
two's complement representation and 0 for a one's complement or
sign-magnitude representation.  <I>b<SUB>max</SUB></I> is the smallest
value greater than or equal to
max(|<I>e<SUB>min</SUB></I>|-<I>K</I>,|<I>e<SUB>max</SUB></I>|) and
equal to 2<I><SUP>M</SUP></I>-1, where <I>M</I> is a non-negative
integer.  <I>b<SUB>min</SUB></I> is zero if <I>e<SUB>min</SUB></I> is
non-negative and -(<I>b<SUB>max</SUB></I>+<I>K</I>) otherwise.  The
size of the smallest bit-field large enough to hold all the values of
the enumeration type is max(<I>M</I>,1) if <I>b<SUB>min</SUB></I> is
zero and <I>M</I>+1 otherwise.

</BLOCKQUOTE>

<P>The result of these calculations is that the number of bits
required for</P>

<PRE>
  enum { N = -1, Z = 0 }
</PRE>

<P>is 1, but the number required for</P>

<PRE>
  enum { N = -1 }
</PRE>

<P>is 2.  This is surprising.  This could be fixed by changing
|<I>e<SUB>max</SUB></I>| to <I>e<SUB>max</SUB></I>.</P>

<BR><BR><HR><A NAME="1638"></A><H4>1638.
  
Declaring an explicit specialization of a scoped enumeration
</H4><B>Section: </B>7.2&#160; [dcl.enum]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-12<BR>




<P>There is no syntax currently for declaring an explicit specialization of
a member scoped enumeration.  A declaration (not a definition) of such an
explicit specialization most resembles an <I>opaque-enum-declaration</I>,
but the grammar for that requires that the name be a simple identifier,
which will not be the case for an explicit specialization of a member
enumeration.  This could be remedied by adding
a <I>nested-name-specifier</I> to the grammar with a restriction that
a <I>nested-name-specifier</I> only appear in an explicit
specialization.</P>

<BR><BR><HR><A NAME="1917"></A><H4>1917.
  
decltype-qualified enumeration names
</H4><B>Section: </B>7.2&#160; [dcl.enum]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-25<BR>


<P>8.3 [dcl.meaning] paragraph 1 and 9 [class]
paragraph 11 prohibit decltype-qualified declarators and class names,
respectively.  There is no such prohibition in 7.2 [dcl.enum]
for enumeration names.  Presumably that is an oversight that should be
rectified.</P>

<BR><BR><HR><A NAME="138"></A><H4>138.
  
Friend declaration name lookup
</H4><B>Section: </B>7.3.1.2&#160; [namespace.memdef]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin von Loewis
 &#160;&#160;&#160;

 <B>Date: </B>14 Jul 1999<BR>





<P>7.3.1.2 [namespace.memdef]
 paragraph 3 says,</P>

<BLOCKQUOTE>
If a <TT>friend</TT> declaration in a non-local class first declares a
class or function the friend class or function is a member of the
innermost enclosing namespace...  When looking for a prior declaration
of a class or a function declared as a <TT>friend</TT>, scopes outside
the innermost enclosing namespace scope are not considered.
</BLOCKQUOTE>

It is not clear from this passage how to determine whether an entity
is "first declared" in a <TT>friend</TT> declaration.  One question is
whether a <I>using-declaration</I> influences this determination.
For instance:

<PRE>
    void foo();
    namespace A{
      using ::foo;
      class X{
	friend void foo();
      };
    }
</PRE>

Is the <TT>friend</TT> declaration a reference to <TT>::foo</TT> or
a different <TT>foo</TT>?

<P>Part of the question involves determining the meaning of
the word "synonym" in
7.3.3 [namespace.udecl]
 paragraph 1:</P>

<BLOCKQUOTE>
A <I>using-declaration</I> introduces a name into the declarative
region in which the <I>using-declaration</I> appears.  That name
is a synonym for the name of some entity declared elsewhere.
</BLOCKQUOTE>

Is "<TT>using ::foo;</TT>" the declaration of a function or not?

<P>More generally, the question is how to describe the lookup of the
name in a <TT>friend</TT> declaration.</P>

<P><U>John Spicer</U>:
When a declaration specifies an unqualified name, that
name is declared, not looked up.  There is a mechanism in which that
declaration is linked to a prior declaration, but that mechanism is
not, in my opinion, via normal name lookup.  So, the friend always
declares a member of the nearest namespace scope regardless of how
that name may or may not already be declared there.</P>

<P><U>Mike Miller</U>:
3.4.1 [basic.lookup.unqual]
 paragraph 7 says:</P>

<BLOCKQUOTE>
A name used in the definition of a class <TT>X</TT> outside of a
member function body or nested class definition shall be declared in
one of the following ways:...  [<I>Note:</I> when looking for a
prior declaration of a class or function introduced by a <TT>friend</TT>
declaration, scopes outside of the innermost enclosing namespace scope
are not considered.]
</BLOCKQUOTE>

The presence of this note certainly implies that this paragraph
describes the lookup of names in <TT>friend</TT> declarations.

<P><U>John Spicer</U>:
It most certainly does not.  If that section described the friend
lookup it would yield the incorrect results for the friend declarations
of <TT>f</TT> and <TT>g</TT> below.
I don't know why that note is there, but it can't
be taken to mean that that is how the friend lookup is done.</P>

<PRE>
    void f(){}
    void g(){}
    class B {
        void g();
    };
    class A : public B {
        void f();
        friend void f(); // ::f not A::f
        friend void g(); // ::g not B::g
    };
</PRE>

<P><U>Mike Miller</U>:
If so, the lookups for friend functions and classes behave differently.
Consider the example in
3.4.4 [basic.lookup.elab]
 paragraph 3:</P>

<PRE>
    struct Base {
        struct Data;         // <I>OK: declares nested</I> Data
        friend class Data;   // <I>OK: nested</I> Data <I>is a friend</I>
    };
</PRE>

<P>If the <TT>friend</TT> declaration is <I>not</I> a reference to
<TT>::foo</TT>, there is a related but separate question: does the
<TT>friend</TT> declaration introduce a conflicting (albeit "invisible")
declaration into namespace <TT>A</TT>, or is it simply a reference
to an as-yet undeclared (and, in this instance, undeclarable)
<TT>A::foo</TT>?  Another part of the example in
3.4.4 [basic.lookup.elab]
 paragraph 3 is
related:</P>

<PRE>
    struct Data {
        friend struct Glob;  // <I>OK: Refers to (as yet) undeclared</I> Glob
                             // <I>at global scope.</I>
    };
</PRE>

<P><U>John Spicer</U>:
You can't refer to something that has not yet been declared.  The friend
is a declaration of <TT>Glob</TT>,
it just happens to declare it in a such a way that
its name cannot be used until it is redeclared.</P>

<P>(A somewhat similar question has been raised in connection with
<A HREF="
     cwg_active.html#36">issue 36</A>.  Consider:</P>

<PRE>
    namespace N {
        struct S { };
    }
    using N::S;
    struct S;          // legal?
</PRE>

<P>According to 9.1 [class.name] paragraph 2,</P>

<BLOCKQUOTE>

A declaration consisting solely of <I>class-key identifier ;</I>
is either a redeclaration of the name in the current scope or a
forward declaration of the identifier as a class name.

</BLOCKQUOTE>

<P>Should the elaborated type declaration in this example be
considered a redeclaration of <TT>N::S</TT> or an invalid
forward declaration of a different class?)</P>

<P>(See also issues
<A HREF="
     cwg_closed.html#95">95</A>,
<A HREF="
     cwg_defects.html#136">136</A>,
<A HREF="
     cwg_defects.html#139">139</A>,
<A HREF="
     cwg_defects.html#143">143</A>,
<A HREF="
     cwg_closed.html#165">165</A>, and
<A HREF="
     cwg_defects.html#166">166</A>, as well as paper J16/00-0006 = WG21
N1229.)</P>





<BR><BR><HR><A NAME="386"></A><H4>386.
  
Friend declaration of name brought in by <I>using-declaration</I>
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Herb Sutter
 &#160;&#160;&#160;

 <B>Date: </B>8 Oct 2002<BR>


<P>The following came up recently on comp.lang.c++.moderated (edited for
brevity):</P>
<PRE>
  namespace N1 {
    template&lt;typename T&gt; void f( T* x ) {
      // ... other stuff ...
      delete x;
    }
  }

  namespace N2 {
    using N1::f;

    template&lt;&gt; void f&lt;int&gt;( int* ); // A: ill-formed

    class Test {
      ~Test() { }
      friend void f&lt;&gt;( Test* x );   // B: ill-formed?
    };
  }
</PRE>
<P>I strongly suspect, but don't have standardese to prove, that the friend
declaration in line B is ill-formed. Can someone show me the text that
allows or disallows line B?</P>

<P>Here's my reasoning: Writing "using" to pull the name into namespace N2
merely allows code in N2 to use the name in a call without qualification
(per 7.3.3 [namespace.udecl]).
But just as declaring a specialization must be done in the
namespace where the template really lives (hence line A is ill-formed), I
suspect that declaring a specialization as a friend must likewise be done
using the original namespace name, not obliquely through a "using". I see
nothing in 7.3.3 [namespace.udecl]
that would permit this use. Is there?</P>

<P><U>Andrey Tarasevich</U>:
14.5.4 [temp.friend] paragraph 2 seems to get pretty close:
"A friend declaration that is not a
template declaration and in which the name of the friend is an unqualified
'template-id' shall refer to a specialization of a function template
declared in the nearest enclosing namespace scope". </P>

<P><U>Herb Sutter</U>:
OK, thanks. Then the question in this is the word "declared" -- in
particular, we already know we cannot declare a specialization of a template
in any other namespace but the original one.</P>

<P><U>John Spicer</U>:
This seems like a simple question, but it isn't.</P>

<P>First of all, I don't think the standard comments on this usage one way 
or the other.</P>

<P>A similar example using a namespace qualified name is ill-formed based 
on 8.3 [dcl.meaning] paragraph 1:</P>
<PRE>
  namespace N1 {
        void f();
  }

  namespace N2 {
        using N1::f;
        class A {
                friend void N2::f();
        };
  }
</PRE>

<P><A HREF="
     cwg_active.html#138">Core issue 138</A> deals with this example:</P>
<PRE>
  void foo();
  namespace A{
    using ::foo;
    class X{
      friend void foo();
    };
  }
</PRE>
<P>The proposed resolution (not yet approved) for
<A HREF="
     cwg_active.html#138">issue 138</A> is that the 
friend declares a new
foo that conflicts with the using-declaration and results in an error.</P>

<P>Your example is different than this though because the presence of the 
explicit argument list
means that this is not declaring a new f but is instead using a 
previously declared f.</P>

<P>One reservation I have about allowing the example is the desire to have 
consistent rules for all of the "declaration like" uses of template 
functions.   <A HREF="
     cwg_defects.html#275">Issue 275</A> (in DR status) addresses the
issue of unqualified names in explicit instantiation and explicit 
specialization declarations.
It requires that such declarations refer to templates from the namespace 
containing the
explicit instantiation or explicit specialization.  I believe this rule 
is necessary for those directives but is not really required for friend 
declarations -- but there is the consistency issue.</P>

<P><B>Notes from April 2003 meeting:</B></P>

<P>This is related to <A HREF="
     cwg_active.html#138">issue 138</A>.  John Spicer
is supposed to update his paper on this topic.  This is a new case
not covered in that paper.  We agreed that the B line should be
allowed.</P>

<BR><BR><HR><A NAME="1713"></A><H4>1713.
  
Linkage of variable template specializations
</H4><B>Section: </B>7.5&#160; [dcl.link]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-08<BR>




<P>Given a namespace-scope declaration like</P>

<PRE>
  template&lt;typename T&gt; T var = T();
</PRE>

<P>should <TT>T&lt;const int&gt;</TT> have internal linkage by virtue
of its const-qualified type?  Or should it inherit the linkage of the
template?</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG noted that linkage is by name, and a specialization of a variable
template does not have a name separate from that of the variable
template, thus the specialization will have the linkage of the template.</P>

<BR><BR><HR><A NAME="1817"></A><H4>1817.
  
Linkage specifications and nested scopes
</H4><B>Section: </B>7.5&#160; [dcl.link]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-04<BR>




<P>According to 7 [dcl.dcl] paragraph 2,</P>

<BLOCKQUOTE>

Unless otherwise stated, utterances in Clause
7 [dcl.dcl] about components in, of, or contained
by a declaration or subcomponent thereof refer only to those
components of the declaration that are not nested within
scopes nested within the declaration.

</BLOCKQUOTE>

<P>This contradicts the intent of 7.5 [dcl.link]
paragraph 4, which says,</P>

<BLOCKQUOTE>

In a <I>linkage-specification</I>, the specified language
linkage applies to the function types of all function
declarators, function names with external linkage, and
variable names with external linkage declared within
the <I>linkage-specification</I>.

</BLOCKQUOTE>

<P>Also, one of the comments in the example in paragraph 4
is inconsistent with the intent:</P>

<PRE>
  extern "C" {
    static void f4(); //<SPAN style="font-family:Times;font-style:italic"> the name of the function f4 has</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> internal linkage (not C language</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> linkage) and the function's type</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> has C language linkage.</SPAN>
  }

  extern "C" void f5() {
    extern void f4(); //<SPAN style="font-family:Times;font-style:italic"> OK: Name linkage (internal)</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> and function type linkage (C</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> language linkage) gotten from</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> previous declaration.</SPAN>
  }
</PRE>

<P>The language linkage for the block-scope declaration of
<TT>f4</TT> is presumably determined by the fact that it
appears in a C-linkage function, not by the previous
declaration.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>Change 7.5 [dcl.link] paragraph 4 as follows:</P>

<BLOCKQUOTE>

<P>Linkage specifications nest. When linkage specifications nest, the
innermost one determines the language linkage. A linkage specification does
not establish a scope. A <I>linkage-specification</I> shall occur only in
namespace scope (3.3 [basic.scope]). In
a <I>linkage-specification</I>, the specified language linkage applies to
the function types of all function declarators, function names with
external linkage, and variable names with external linkage declared within
the <I>linkage-specification</I><SPAN style="font-weight:bold;background-color:#A0FFA0">, including those appearing in scopes
nested inside the linkage specification and not inside a nested
<I>linkage-specification</I></SPAN>. [<I>Example:</I></P>

<P>...</P>

<PRE>
  extern "C" {
    static void f4(); //<SPAN style="font-family:Times;font-style:italic"> the name of the function </SPAN>f4<SPAN style="font-family:Times;font-style:italic"> has</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> internal linkage (not C language</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> linkage) and the function's type</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> has C language linkage.</SPAN>
  }

  extern "C" void f5() {
    extern void f4(); //<SPAN style="font-family:Times;font-style:italic"> OK: Name linkage (internal)</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">and function type linkage (C</SPAN></SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">language linkage)</SPAN> gotten from</SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> previous declaration<SPAN style="text-decoration:line-through;background-color:#FFA0A0">.</SPAN><SPAN style="font-weight:bold;background-color:#A0FFA0">; function type</SPAN></SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> <SPAN style="font-weight:bold;background-color:#A0FFA0">linkage (C language</SPAN></SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> <SPAN style="font-weight:bold;background-color:#A0FFA0">linkage) gotten</SPAN></SPAN>
                      //<SPAN style="font-family:Times;font-style:italic"> <SPAN style="font-weight:bold;background-color:#A0FFA0">from linkage specification</SPAN></SPAN>
  }
</PRE>

</BLOCKQUOTE>

<P><B>Additional note, November, 2014:</B></P>

<P>The issue has been returned to "drafting" status to clarify the
circumstances under which a preceding declaration supplies the
language linkage for a declaration (for example, not when the
declaration uses a typedef, which carries the language linkage,
but only when the declaration uses a function declarator).
</P>

<BR><BR><HR><A NAME="1706"></A><H4>1706.
  
<TT>alignas</TT> pack expansion syntax
</H4><B>Section: </B>7.6.1&#160; [dcl.attr.grammar]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-26<BR>


<P>The grammar for <I>alignment-specifier</I> in 7.6.1 [dcl.attr.grammar]
paragraph 1 is:</P>

<UL><I>alignment-specifier:</I>
<UL><TT>alignas (</TT> <I>type-id</I> <TT>...</TT><I><SUB>opt</SUB></I><TT>)</TT><BR>
<TT>alignas (</TT> <I>assignment-expression</I> <TT>...</TT><I><SUB>opt</SUB></I><TT>)</TT>

</UL>

</UL>

<P>where the ellipsis indicates pack expansion.  Naively, one would expect
that the expansion would result in forms like</P>

<PRE>
    alignas()
    alignas(1, 2)
    alignas(int, double) 
</PRE>

<P>but none of those forms is given any meaning by the current wording.
Instead, 14.5.3 [temp.variadic] paragraph 4 says,</P>

<BLOCKQUOTE>

In an <I>alignment-specifier</I> (7.6.2 [dcl.align]); the pattern
is the <I>alignment-specifier</I> without the ellipsis.

</BLOCKQUOTE>

<P>Presumably this means that something like <TT>alignas(T...)</TT> would
expand to something like</P>

<PRE>
    alignas(int) alignas(double)
</PRE>

<P>This is counterintuitive and should be reexamined.</P>



<P>See also messages <A href="
   http://accu.org/cgi-bin/wg21/message?wg=core&amp;msg=24016">24016</A> through <A href="
   http://accu.org/cgi-bin/wg21/message?wg=core&amp;msg=24021">24021</A>.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG decided to change the pack expansion of <TT>alignas</TT> so that
the <I>type-id</I> or <I>assignment-expression</I> is repeated inside
the parentheses and to change the definition of <TT>alignas</TT> to
accept multiple arguments with the same meaning as multiple <TT>alignas</TT>
specifiers.</P>

<BR><BR><HR><A NAME="2027"></A><H4>2027.
  
Unclear requirements for multiple <TT>alignas</TT> specifiers
</H4><B>Section: </B>7.6.2&#160; [dcl.align]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-20<BR>




<P>The description of <I>alignment-specifier</I>s is unclear.  For
example, 7.6.2 [dcl.align] bullet 2.2 says,</P>

<BLOCKQUOTE>

if the constant expression evaluates to a fundamental alignment, the
alignment requirement of the declared entity shall be the specified
fundamental alignment

</BLOCKQUOTE>

<P>However, paragraph 4 says,</P>

<BLOCKQUOTE>

When multiple <I>alignment-specifier</I>s are specified for an entity, the
alignment requirement shall be set to the strictest specified alignment.

</BLOCKQUOTE>

<P>meaning that a less-strict alignment will be ignored, rather than
being the alignment of the entity, and presumably meaning that no
diagnostic is required for an insufficiently-strict alignment if a
more stringent requirement is also supplied.</P>

<BR><BR><HR><A NAME="1342"></A><H4>1342.
  
Order of initialization with multiple declarators
</H4><B>Section: </B>8&#160; [dcl.decl]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Alberto Ganesh Barbati
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-11<BR>




<P>It is not clear what, if anything, in the existing specification
requires that the initialization of multiple <I>init-declarator</I>s
within a single declaration be performed in declaration order.</P>

<BR><BR><HR><A NAME="1488"></A><H4>1488.
  
<I>abstract-pack-declarator</I>s in <I>type-id</I>s
</H4><B>Section: </B>8.1&#160; [dcl.name]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-03-28<BR>




<P>The grammar for <I>type-id</I> in 9.1 [class.name] paragraph
1 has two problems.  First, the fact that we allow an
<I>abstract-pack-declarator</I> makes some uses of <I>type-id</I>
(template arguments, alignment specifiers, exception-specifications)
ambiguous: <TT>T...</TT> could be parsed either as a <I>type-id</I>,
including the ellipsis, or as the <I>type-id</I> <TT>T</TT> with a
following ellipsis.  There does not appear to be any rule to
disambiguate these parses.</P>

<P>The other problem is that we do not allow parentheses in an
<I>abstract-pack-declarator</I>, which makes</P>

<PRE>
  template&lt;typename...Ts&gt; void f(Ts (&amp;...)[4]);
</PRE>

<P>ill-formed because <TT>(&amp;...)()</TT> is not an
<I>abstract-pack-declarator</I>.  There is implementation variance
on this point.</P>

<BR><BR><HR><A NAME="1900"></A><H4>1900.
  
Do <TT>friend</TT> declarations count as &#8220;previous declarations&#8221;?
</H4><B>Section: </B>8.3&#160; [dcl.meaning]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-25<BR>




<P><A HREF="
     cwg_defects.html#1477">Issue 1477</A> assumes that a name
declared only in a <TT>friend</TT> declaration can be defined outside
its namespace using a <I>qualified-id</I>, but the normative
passages in 8.3 [dcl.meaning] paragraph 1 and
7.3.1.2 [namespace.memdef] paragraph 2 do not settle the question
definitively, and there is implementation variance.  A clearer
statement of intent is needed.</P>

<BR><BR><HR><A NAME="453"></A><H4>453.
  
References may only bind to &#8220;valid&#8221; objects
</H4><B>Section: </B>8.3.2&#160; [dcl.ref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gennaro Prota
 &#160;&#160;&#160;

 <B>Date: </B>18 Jan 2004<BR>


<P>8.3.2 [dcl.ref] paragraph 4 says:</P>
<BLOCKQUOTE>
  A reference shall be initialized to refer to a valid object or
  function. [Note: in particular, a null reference cannot exist
  in a well-defined program, because the only way to create such
  a reference would be to bind it to the "object" obtained by
  dereferencing a null pointer, which causes undefined behavior
  ...]
</BLOCKQUOTE>
<P>What is a "valid" object? In particular the expression "valid object"
seems to exclude uninitialized objects, but the response to Core Issue
363 clearly says that's not the intent. This is an example
(overloading construction on constness of *this) by John Potter, which
I think is supposed to be legal C++ though it binds references to
objects that are not initialized yet:</P>
<PRE>
 struct Fun {
    int x, y;
    Fun (int x, Fun const&amp;) : x(x), y(42) { }
    Fun (int x, Fun&amp;) : x(x), y(0) { }
  };
  int main () {
    const Fun f1 (13, f1);
    Fun f2 (13, f2);
    cout &lt;&lt; f1.y &lt;&lt; " " &lt;&lt; f2.y &lt;&lt; "\n";
  }
</PRE>

<P>Suggested resolution: Changing the final part of
8.3.2 [dcl.ref] paragraph 4 to:</P>
<BLOCKQUOTE>
  A reference shall be initialized to refer to an object or function.
  From its point of declaration on (see 3.3.2 [basic.scope.pdecl])
  its name is an lvalue
  which refers to that object or function. The reference may be
  initialized to refer to an uninitialized object but, in that case,
  it is usable in limited ways (3.8 [basic.life], paragraph 6)
  [Note: On the other hand, a declaration like this:
<PRE>
    int &amp; ref = *(int*)0;
</PRE>
  is ill-formed because ref will not refer to any object or function
  ]
</BLOCKQUOTE>

<P>I also think a "No diagnostic is required." would better be added
(what about something like int&amp; r = r; ?)</P>

<P><B>Proposed Resolution (October, 2004):</B></P>

<P>(Note: the following wording depends on the proposed
resolution for <A HREF="
     cwg_active.html#232">issue 232</A>.)</P>

<P>Change 8.3.2 [dcl.ref] paragraph 4 as follows:</P>
<BLOCKQUOTE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">A reference shall be initialized to refer to a valid object
or function.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">If an lvalue to which a reference is directly
bound designates neither an existing object or function of an
appropriate type (8.5.3 [dcl.init.ref]), nor a region of
memory of suitable size and alignment to contain an object of the
reference's type (1.8 [intro.object], 3.8 [basic.life], 3.9 [basic.types]), the behavior is
undefined.</SPAN> [<I>Note:</I> in particular, a null reference cannot
exist in a well-defined program, because the only way to create
such a reference would be to bind it to the
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">&#8220;object&#8221;</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">empty lvalue</SPAN> obtained by
dereferencing a null pointer, which <SPAN style="text-decoration:line-through;background-color:#FFA0A0">causes undefined behavior.
As</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">does not designate an object or function.  Also, as
</SPAN> described in 9.6 [class.bit],
a reference cannot be bound directly to a
bit-field. ]</P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">The name of a reference shall not be used in its own
initializer.  Any other use of a reference before it is
initialized results in undefined behavior.  [<I>Example:</I>
</SPAN></P>

<SPAN style="font-weight:bold;background-color:#A0FFA0">
<PRE>
  int&amp; f(int&amp;);
  int&amp; g();

  extern int&amp; ir3;
  int* ip = 0;

  int&amp; ir1 = *ip;     // <I>undefined behavior: null pointer</I>
  int&amp; ir2 = f(ir3);  // <I>undefined behavior: </I>ir3<I> not yet initialized</I>
  int&amp; ir3 = g();
  int&amp; ir4 = f(ir4);  // <I>ill-formed: </I>ir4<I> used in its own initializer</I>
</PRE>
&#8212;<I>end example</I>]
</SPAN>
</BLOCKQUOTE>

<P><B>Rationale: </B> The proposed wording goes beyond the specific
concerns of the issue.  It was noted that, while the current
wording makes cases like <TT>int&amp; r = r;</TT> ill-formed (because
<TT>r</TT> in the initializer does not "refer to a valid object"), an
inappropriate initialization can only be detected, if at all, at
runtime and thus "undefined behavior" is a more appropriate treatment.
Nevertheless, it was deemed desirable to continue to require a
diagnostic for obvious compile-time cases.
</P>

<P>It was also noted that the current Standard does not say anything
about using a reference before it is initialized.  It seemed
reasonable to address both of these concerns in the same wording
proposed to resolve this issue.
</P>

<P><B>Notes from the April, 2005 meeting:</B></P>

<P>The CWG decided that whether to require an implementation to
diagnose initialization of a reference to itself should be handled as
a separate issue (<A HREF="
     cwg_active.html#504">504</A>) and also suggested referring
to &#8220;storage&#8221; instead of &#8220;memory&#8221; (because
1.8 [intro.object] defines an object as a &#8220;region of
storage&#8221;).</P>

<P><B>Proposed Resolution (April, 2005):</B></P>

<P>(Note: the following wording depends on the proposed
resolution for <A HREF="
     cwg_active.html#232">issue 232</A>.)</P>

<P>Change 8.3.2 [dcl.ref] paragraph 4 as follows:</P>
<BLOCKQUOTE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">A reference shall be initialized to refer to a valid object
or function.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">If an lvalue to which a reference is directly
bound designates neither an existing object or function of an
appropriate type (8.5.3 [dcl.init.ref]), nor a region of
storage of suitable size and alignment to contain an object of the
reference's type (1.8 [intro.object], 3.8 [basic.life], 3.9 [basic.types]), the behavior is
undefined.</SPAN> [<I>Note:</I> in particular, a null reference cannot
exist in a well-defined program, because the only way to create
such a reference would be to bind it to the
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">&#8220;object&#8221;</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">empty lvalue</SPAN> obtained by
dereferencing a null pointer, which <SPAN style="text-decoration:line-through;background-color:#FFA0A0">causes undefined behavior.
As</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">does not designate an object or function.  Also, as
</SPAN> described in 9.6 [class.bit],
a reference cannot be bound directly to a
bit-field. ]</P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">Any use of a reference before it is initialized results in
undefined behavior.  [<I>Example:</I>
</SPAN></P>

<SPAN style="font-weight:bold;background-color:#A0FFA0">
<PRE>
  int&amp; f(int&amp;);
  int&amp; g();

  extern int&amp; ir3;
  int* ip = 0;

  int&amp; ir1 = *ip;     // <SPAN style="font-family:Times;font-style:italic">undefined behavior: null pointer</SPAN>
  int&amp; ir2 = f(ir3);  // <SPAN style="font-family:Times;font-style:italic">undefined behavior: </SPAN>ir3<SPAN style="font-family:Times;font-style:italic"> not yet initialized</SPAN>
  int&amp; ir3 = g();
  int&amp; ir4 = f(ir4);  // <SPAN style="font-family:Times;font-style:italic">undefined behavior: </SPAN>ir4<SPAN style="font-family:Times;font-style:italic"> used in its own initializer</SPAN>
</PRE>
&#8212;<I>end example</I>]
</SPAN>
</BLOCKQUOTE>

<P><B>Note (February, 2006):</B></P>

<P>The word &#8220;use&#8221; in the last
paragraph of the proposed resolution was intended to refer to the
description in 3.2 [basic.def.odr] paragraph 2.  However, that
section does not define what it means for a reference to be
&#8220;used,&#8221; dealing only with objects and functions.  Additional
drafting is required to extend 3.2 [basic.def.odr] paragraph 2
to apply to references.  </P>

<P><B>Additional note (May, 2008):</B></P>

<P>The proposed resolution for <A HREF="
     cwg_defects.html#570">issue 570</A>
adds wording to define &#8220;use&#8221; for references.</P>

<P><B>Note, January, 2012:</B></P>

<P>The resolution should also probably deal with the fact that
the &#8220;one-past-the-end&#8221; address of an array does not
designate a valid object (even if such a pointer might
&#8220;point to&#8221; an object of the correct type, per
3.9.2 [basic.compound]) and thus is not suuitable for the
lvalue-to-rvalue conversion.  </P>

<BR><BR><HR><A NAME="1640"></A><H4>1640.
  
Array of abstract instance of class template
</H4><B>Section: </B>8.3.4&#160; [dcl.array]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-14<BR>




<P>According to 8.3.4 [dcl.array] paragraph 1, an array
declarator whose element type is an abstract class is ill-formed.
However, if the element type is a class template specialization, it
may not be known that the class is abstract; because forming an array
of an incomplete type is permitted (3.9 [basic.types] paragraphs
5-6), the class template is not required to be instantiated in order
to use it as an element type.  The expected handling if the class
template is later instantiated is unclear; should the compiler issue
an error about the earlier array array type at the point at which the
class template is instantiated?</P>

<P>This also affects overload resolution:</P>

<PRE>
  template&lt;typename&gt; struct Abstract {
    virtual void f() = 0;
    typedef int type;
  };
  template&lt;typename T&gt; char &amp;abstract_test(T[1]);      //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
  template&lt;typename T&gt; char (&amp;abstract_test(...))[2];  //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
  // Abstract&lt;int&gt;::type n;
  static_assert(sizeof(abstract_test&lt;Abstract&lt;int&gt;&gt;(nullptr)) == 2, "");
</PRE>

<P>Overload resolution will select #1 and fail the assertion; if the
commented line is uncommented, there is implementation variance, but
presumably #2 should be selected and satisfy the assertion.</P>

<P>These effects of completing the type are troublesome.  Would it
be better to allow array types of abstract element type and simply
prohibit creation of objects of such arrays?</P>

<P>(See also <A HREF="
     cwg_active.html#1646">issue 1646</A>.)</P>

<BR><BR><HR><A NAME="1001"></A><H4>1001.
  
Parameter type adjustment in dependent parameter types
</H4><B>Section: </B>8.3.5&#160; [dcl.fct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2009-11-08<BR>




<P>According to 8.3.5 [dcl.fct] paragraph 5,
top-level cv-qualifiers on parameter types are deleted when
determining the function type.  It is not clear how or whether
this adjustment should be applied to parameters of function
templates when the parameter has a dependent type, however.  For
example:</P>

<PRE>
    template&lt;class T&gt; struct A {
       typedef T arr[3];
    };

    template&lt;class T&gt; void f(const typename A&lt;T&gt;::arr) { } // #1

    template void f&lt;int&gt;(const A&lt;int&gt;::arr);

    template &lt;class T&gt; struct B {
       void g(T);
    };

    template &lt;class T&gt; void B&lt;T&gt;::g(const T) { } // #2
</PRE>

<P>If the <TT>const</TT> in #1 is dropped, <TT>f&lt;int&gt;</TT> has
a parameter type of <TT>A*</TT> rather than the <TT>const A*</TT>
specified in the explicit instantiation.  If the <TT>const</TT> in
#2 is <I>not</I> dropped, we fail to match the definition of
<TT>B::g</TT> to its declaration.
</P>

<P><B>Rationale (November, 2010):</B></P>


<P>The CWG agreed that this behavior is intrinsic to the different
ways cv-qualification applies to array types and non-array types.
</P>

<P><B>Notes, January, 2012:</B></P>

<P>Additional discussion of this issue arose regarding the following
example:</P>

<PRE>
    template&lt;class T&gt; struct A {
      typedef double Point[2];
      virtual double calculate(const Point point) const = 0;
    };

    template&lt;class T&gt; struct B : public A&lt;T&gt; {
      virtual double calculate(const typename A&lt;T&gt;::Point point) const {
        return point[0];
      }
    };

    int main() {
      B&lt;int&gt; b;
      return 0;
    }
</PRE>

<P>The question is whether the member function in
<TT>B&lt;int&gt;</TT> has the same type as that in
<TT>A&lt;int&gt;</TT>: is the parameter-type-list instantiated
directly (i.e., using the adjusted types) or regenerated from the
individual parameter types? </P>

<P>(See also <A HREF="
     cwg_active.html#1322">issue 1322</A>.)</P>

<BR><BR><HR><A NAME="1668"></A><H4>1668.
  
Parameter type determination still not clear enough
</H4><B>Section: </B>8.3.5&#160; [dcl.fct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-25<BR>




<P>According to 8.3.5 [dcl.fct] paragraph 5,</P>

<BLOCKQUOTE>

The type of a function is determined using the following rules. The type of
each parameter (including function parameter packs) is determined from its
own <I>decl-specifier-seq</I> and <I>declarator</I>. After determining the
type of each parameter, any parameter of type &#8220;array
of <TT>T</TT>&#8221; or &#8220;function returning <TT>T</TT>&#8221; is
adjusted to be &#8220;pointer to <TT>T</TT>&#8221; or &#8220;pointer to
function returning <TT>T</TT>,&#8221; respectively. After producing the
list of parameter types, any top-level <I>cv-qualifier</I>s modifying a
parameter type are deleted when forming the function type. The resulting
list of transformed parameter types and the presence or absence of the
ellipsis or a function parameter pack is the function's
<I>parameter-type-list</I>. [<I>Note:</I> This transformation does not
affect the types of the parameters. For example, <TT>int(*)(const int p,
decltype(p)*)</TT> and <TT>int(*)(int, const int*)</TT> are identical
types. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>This is not sufficiently clear to specify the intended handling of an
example like</P>

<PRE>
  void f(int a[10], decltype(a) *p );
</PRE>

<P>Should the type of <TT>p</TT> be <TT>int(*)[10]</TT>
or <TT>int**</TT>?  The latter is the intended result, but the phrase
&#8220;after determining the type of each parameter&#8221; makes it
sound as if the adjustments are performed after all the parameter
types have been determined from the <I>decl-specifier-seq</I> and
<I>declarator</I> instead of for each parameter individually.</P>

<P>See also <A HREF="
     cwg_active.html#1444">issue 1444</A>.</P>

<BR><BR><HR><A NAME="325"></A><H4>325.
  
When are default arguments parsed?
</H4><B>Section: </B>8.3.6&#160; [dcl.fct.default]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nathan Sidwell
 &#160;&#160;&#160;

 <B>Date: </B>27 Nov 2001<BR>


<P>The standard is not precise enough about when the default arguments of
member functions are parsed.  This leads to confusion over whether certain
constructs are legal or not, and the validity of certain compiler
implementation algorithms.</P>

<P>8.3.6 [dcl.fct.default] paragraph 5 says "names in the
expression are bound, and
the semantic constraints are checked, at the point where the default
argument expression appears"</P>

<P>However, further on at paragraph 9 in the same section there is an example,
where the salient parts are
<PRE>
  int b;
  class X {
    int mem2 (int i = b); // OK use X::b
    static int b;
  };
</PRE>
which appears to contradict the former constraint. At the point the default
argument expression appears in the definition of X, X::b has not been
declared, so one would expect ::b to be bound.  This of course appears to
violate 3.3.7 [basic.scope.class] paragraph 1(2) "A name N used in
a class S shall
refer to the same declaration in its context and when reevaluated in the
complete scope of S. No diagnostic is required."</P>

<P>Furthermore 3.3.7 [basic.scope.class] paragraph 1(1) gives the
 scope of names declared
in class to "consist not only of the declarative region following
the name's declarator, but also of .. default arguments ...". Thus implying
that X::b is in scope in the default argument of X::mem2 previously.</P>

<P>That previous paragraph hints at an implementation technique of saving the
token stream of a default argument expression and parsing it at the end of
the class definition (much like the bodies of functions defined in the
class).  This is a technique employed by GCC and, from its behaviour, in
the EDG front end.  The standard leaves two things unspecified. 
Firstly, is a default argument expression permitted to call a static member
function declared later in the class in such a way as to require evaluation of
that function's default arguments? I.e. is the following well formed?
<PRE>
  class A {
    static int Foo (int i = Baz ());
    static int Baz (int i = Bar ());
    static int Bar (int i = 5);
 };
</PRE>
If that is well formed, at what point does the non-sensicalness of
<PRE>
  class B {
    static int Foo (int i = Baz ());
    static int Baz (int i = Foo());
  };
</PRE>
become detected? Is it when B is complete? Is it when B::Foo or B::Baz is
called in such a way to require default argument expansion? Or is no
diagnostic required?</P>

<P>The other problem is with collecting the tokens that form the default
argument expression.  Default arguments which contain template-ids with
more than one parameter present a difficulty in determining when the
default argument finishes.  Consider,
<PRE>
  template &lt;int A, typename B&gt; struct T { static int i;};
  class C {
    int Foo (int i = T&lt;1, int&gt;::i);
  };
</PRE>
The default argument contains a non-parenthesized comma.  Is it required
that this comma is seen as part of the default argument expression and not
the beginning of another of argument declaration?  To accept this as
part of the default argument would require name lookup of T (to determine
that the '&lt;' was part of a template argument list and not a less-than
operator) before C is complete.  Furthermore, the more pathological
<PRE>
  class D {
    int Foo (int i = T&lt;1, int&gt;::i);
    template &lt;int A, typename B&gt; struct T {static int i;};
  };
</PRE>
would be very hard to accept. Even though T is declared after Foo, T is
in scope within Foo's default argument expression.</P>

<P><B>Suggested resolution:</B></P>

<P>Append the following text to 8.3.6 [dcl.fct.default] paragraph 8.</P>
<BLOCKQUOTE>
	The default argument expression of a member function declared in 
	the class definition consists of the sequence of tokens up until
	the next non-parenthesized, non-bracketed comma or close
	parenthesis.  Furthermore such default argument expressions shall
	not require evaluation of a default argument of a function
	declared later in the class.
</BLOCKQUOTE>

<P>This would make the above A, B, C and D ill formed and is in line with the
existing compiler practice that I am aware of.</P>

<P><B>Notes from the October, 2005 meeting:</B></P>

<P>The CWG agreed that the first example (<TT>A</TT>) is currently
well-formed and that it is not unreasonable to expect implementations
to handle it by processing default arguments recursively.</P>

<P><B>Additional notes, May, 2009:</B></P>

<P>Presumably the following is ill-formed:</P>

<PRE>
    int f(int = f());
</PRE>

<P>However, it is not clear what in the Standard makes it so.  Perhaps
there needs to be a statement to the effect that a default argument
only becomes usable after the complete declarator of which it is a
part.</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>In addition to default arguments, commas in template argument lists
also cause problems in initializers for nonstatic data members:</P>

<PRE>
    struct S {
      int n = T&lt;a,b&gt;(c);  //<SPAN style="font-family:Times;font-style:italic"> ill-formed declarator for member</SPAN> b
                          //<SPAN style="font-family:Times;font-style:italic"> or template argument?</SPAN>
    };
</PRE>

<commmittee_only><P>(This is from #16 of the
<TT>IssuesFoundImplementingC0x.pdf</TT> document on the Bloomington
wiki.</P></commmittee_only>

<P><B>Additional notes (August, 2011):</B></P>

<P>See also issues <A HREF="
     cwg_defects.html#1352">1352</A> and
<A HREF="
     cwg_active.html#361">361</A>. </P>

<P><B>Notes from the February, 2012 meeting:</B></P>

<P>It was decided to handle the question of parsing an initializer
like <TT>T&lt;a,b&gt;(c)</TT> (a <I>template-id</I> or two
declarators) in this issue and the remaining questions in <A HREF="
     cwg_active.html#361">issue 361</A>.  For this issue, a <I>template-id</I> will
only be recognized if there is a preceding declaration of a template.</P>



<BR><BR><HR><A NAME="1580"></A><H4>1580.
  
Default arguments in explicit instantiations
</H4><B>Section: </B>8.3.6&#160; [dcl.fct.default]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2012-10-29<BR>


<P>It is not clear, either from 8.3.6 [dcl.fct.default] or
14.7.2 [temp.explicit], whether it is permitted to add a default
argument in an explicit instantiation of a function template:</P>

<PRE>
  template&lt;typename T&gt; void f(T, int) { }
  template void f&lt;int&gt;(int, int=0);  //<SPAN style="font-family:Times;font-style:italic"> Permitted?</SPAN>
</PRE>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>The intent is to prohibit default arguments in explicit instantiations.</P>

<BR><BR><HR><A NAME="1733"></A><H4>1733.
  
Return type and value for <TT>operator=</TT> with <I>ref-qualifier</I>
</H4><B>Section: </B>8.4.2&#160; [dcl.fct.def.default]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-09<BR>




<P>8.4.2 [dcl.fct.def.default] paragraph 1 specifies that an
explicitly-defaulted function shall</P>

<BLOCKQUOTE>

have the same declared function type (except for possibly
differing <I>ref-qualifier</I>s and except that in the case of a copy
constructor or copy assignment operator, the parameter type may be
&#8220;reference to non-const <TT>T</TT>&#8221;, where <TT>T</TT> is the
name of the member function's class) as if it had been implicitly
declared...

</BLOCKQUOTE>

<P>This allows an example like</P>

<PRE>
  struct A {
    A&amp; operator=(A const&amp;) &amp;&amp; = default; 
  };
</PRE>

<P>but forbids</P>

<PRE>
  struct B {
    B&amp;&amp; operator=(B const&amp;) &amp;&amp; = default; 
  };
</PRE>

<P>which seems backward.</P>

<P>In addition, 12.8 [class.copy] paragraph 22 only specifies the
return value for implicitly-declared copy/move assignment operators,
not for explicitly-defaulted ones.</P>

<BR><BR><HR><A NAME="1854"></A><H4>1854.
  
Disallowing use of implicitly-deleted functions
</H4><B>Section: </B>8.4.2&#160; [dcl.fct.def.default]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-11<BR>


<P>The resolution of <A HREF="
     cwg_defects.html#1778">issue 1778</A> means that
whether an explicitly-defaulted function is deleted or not cannot be
known until the end of the class definition.  As a result, new rules
are required to disallow references (in, e.g., <TT>decltype</TT>) to
explicitly-defaulted functions that might later become deleted.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>The approach favored by CWG was to make any reference to an
explicitly-defaulted function ill-formed if it occurs prior to the
end of the class definition.</P>

<BR><BR><HR><A NAME="2015"></A><H4>2015.
  
odr-use of deleted virtual functions
</H4><B>Section: </B>8.4.3&#160; [dcl.fct.def.delete]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Majnemer
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-05<BR>


<P>It is not clear that the odr-use of a virtual function described in
3.2 [basic.def.odr] paragraph 3 is exempt from the prohibition
against referring to a deleted function (8.4.3 [dcl.fct.def.delete]
paragraph 2).</P>

<BR><BR><HR><A NAME="253"></A><H4>253.
  
Why must empty or fully-initialized const objects be initialized?
</H4><B>Section: </B>8.5&#160; [dcl.init]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>11 Jul 2000<BR>




<P>Paragraph 9 of
8.5 [dcl.init]

 says:</P>
<BLOCKQUOTE>If no initializer is specified for an object, and the object
is of (possibly cv-qualified) non-POD class type (or array thereof), the
object shall be default-initialized; if the object is of const-qualified
type, the underlying class type shall have a user-declared default constructor.
Otherwise, if no initializer is specified for an object, the object and
its subobjects, if any, have an indeterminate initial value; if the object
or any of its subobjects are of const-qualified type, the program is ill-formed.</BLOCKQUOTE>

<P>What if a const POD object has no non-static data members?
This wording requires an empty initializer for such cases:</P>

<PRE>
    struct Z {
        // no data members
        operator int() const { return 0; }
    };

    void f() {
        const Z z1;         // ill-formed: no initializer
        const Z z2 = { };   // well-formed
    }
</PRE>

<P>Similar comments apply to a non-POD const object, all of whose
non-static data members and base class subobjects have default
constructors.  Why should the class of such an object be required
to have a user-declared default constructor?</P>

<P>(See also <A HREF="
     cwg_defects.html#78">issue 78</A>.)</P>

<P><B>Additional note (February, 2011):</B></P>

<P>This issue should be brought up again in light of constexpr
constructors and non-static data member initializers.
</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>If the implicit default constructor initializes all subobjects,
no initializer should be required.</P>



<BR><BR><HR><A NAME="1997"></A><H4>1997.
  
Placement new and previous initialization
</H4><B>Section: </B>8.5&#160; [dcl.init]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-08<BR>




<P>Given the following example,</P>

<PRE>
  #include &lt;new&gt;

  int main() {
    unsigned char buf[sizeof(int)] = {};
    int *ip = new (buf) int;
    return *ip; //<SPAN style="font-family:Times;font-style:italic"> </SPAN>0<SPAN style="font-family:Times;font-style:italic"> or undefined?</SPAN>
  }
</PRE>

<P>Should the preceding initializsation of the buffer carry over to
the value of <TT>*ip</TT>?  According to 8.5 [dcl.init]
paragraph 12,</P>

<BLOCKQUOTE>

When storage for an object with automatic or dynamic storage
duration is obtained, the object has an <TT>indeterminate value</TT>,
and if no initialization is performed for the object, that
object retains an indeterminate value until that value is
replaced (5.18 [expr.ass]).

</BLOCKQUOTE>

<P>In this case, no new storage is being obtained for the
<TT>int</TT> object created by the <I>new-expression</I>.</P>

<BR><BR><HR><A NAME="1622"></A><H4>1622.
  
Empty aggregate initializer for union
</H4><B>Section: </B>8.5.1&#160; [dcl.init.aggr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-14<BR>


<P>According to 8.5.1 [dcl.init.aggr] paragraph 15,</P>

<BLOCKQUOTE>

When a union is initialized with a brace-enclosed initializer, the braces
shall only contain an <I>initializer-clause</I> for the first non-static
data member of the union.

</BLOCKQUOTE>

<P>This would appear to preclude using <TT>{}</TT> as the initializer for a
union, which would otherwise have reasonable semantics.  Is there a reason
for this restriction?</P>

<P>Also, paragraph 7 reads,</P>

<BLOCKQUOTE>

If there are fewer <I>initializer-clause</I>s in the list than there are
members in the aggregate, then each member not explicitly initialized shall
be initialized from an empty initializer list (8.5.4 [dcl.init.list]).

</BLOCKQUOTE>

<P>There should presumably be special treatment for unions, so that only
a single member is initialized in such cases.</P>

<P>(See also <A HREF="
     cwg_defects.html#1460">issue 1460</A>.)</P>

<BR><BR><HR><A NAME="1304"></A><H4>1304.
  
Omitted array bound with string initialization
</H4><B>Section: </B>8.5.2&#160; [dcl.init.string]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-26<BR>




<P>The example in 8.5.2 [dcl.init.string] paragraph
1 says,</P>

<BLOCKQUOTE>

<PRE>
  char msg[] = "Syntax error on line %s\n";
</PRE>

<P>shows a character array whose members are initialized with a
<I>string-literal</I>.  Note that because <TT>'\n'</TT> is a single
character and because a trailing <TT>'\0'</TT> is appended,
<TT>sizeof(msg)</TT> is <TT>25</TT>.
</P>

</BLOCKQUOTE>

<P>However, there appears to be no normative specification of how the
size of the array is to be calculated.</P>

<BR><BR><HR><A NAME="1414"></A><H4>1414.
  
Binding an rvalue reference to a reference-unrelated lvalue
</H4><B>Section: </B>8.5.3&#160; [dcl.init.ref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2011-11-09<BR>




<P>Currently an attempt to bind an rvalue reference to a
reference-unrelated lvalue succeeds, binding the reference to a
temporary initialized from the lvalue by copy-initialization.  This
appears to be intentional, as the accompanying example contains the
lines</P>

<PRE>
    int i3 = 2;
    double&amp;&amp; rrd3 = i3;  //<SPAN style="font-family:Times;font-style:italic"> </SPAN>rrd3<SPAN style="font-family:Times;font-style:italic"> refers to temporary with value </SPAN>2.0
</PRE>

<P>This violates the expectations of some who expect that rvalue
references can be initialized only with rvalues.  On the other
hand, it is parallel with the handling of an lvalue
reference-to-const (and is handled by the same wording).  It also
can add efficiency without requiring existing code to be rewritten:
the implicitly-created temporary can be moved from, just as if the
call had been rewritten to create a prvalue temporary from the
lvalue explicitly.</P>

<P>On a related note, assuming the binding is permitted, the intent of
the overload tiebreaker found in 13.3.3.2 [over.ics.rank]
paragraph 3 is not clear:</P>

<UL><LI><P>Standard conversion sequence <TT>S1</TT> is a better conversion
sequence than standard conversion sequence <TT>S2</TT> if</P></LI>

<UL><LI><P>...</P></LI>

<LI><P><TT>S1</TT> and <TT>S2</TT> are reference bindings
(8.5.3 [dcl.init.ref]) and neither refers to an implicit
object parameter of a non-static member function declared without
a <I>ref-qualifier</I>, and <TT>S1</TT> binds an rvalue reference
to an rvalue and <TT>S2</TT> binds an lvalue reference.</P></LI>

</UL>

</UL>

<P>At question is what &#8220;to an rvalue&#8221; means here.  If it
is referring to the value category of the initializer itself,
before conversions, then the supposed performance advantage of
the binding under discussion does not occur because the competing
rvalue and lvalue reference overloads will be ambiguous:</P>

<PRE>
    void f(int&amp;&amp;);    //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    void f(const int&amp;);
    void g(double d) {
        f(d);         //<SPAN style="font-family:Times;font-style:italic"> ambiguous: #1 does not bind to an rvalue</SPAN>
    }
</PRE>

<P>On the other hand, if &#8220;to an rvalue&#8221; refers to the
actual object to which the reference is bound, i.e., to the temporary
in the case under discussion, the phrase would seem to be vacuous because
an rvalue reference can never bind directly to an lvalue.</P>

<P><B>Notes from the February, 2012 meeting:</B></P>

<P>CWG agreed that the binding rules are correct, allowing creation of
a temporary when binding an rvalue reference to a non-reference-related
lvalue.  The phrase &#8220;to an rvalue&#8221; in
13.3.3.2 [over.ics.rank] paragraph 3 is a leftover from before
binding an rvalue reference to an lvalue was prohibited and should be
removed. A change is also needed to handle the following case:</P>

<PRE>
    void f(const char (&amp;)[1]);         //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    template&lt;typename T&gt; void f(T&amp;&amp;);  //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
    void g() {
      f("");                           //<SPAN style="font-family:Times;font-style:italic">calls #2, should call #1</SPAN>
    }
</PRE>

<P><B>Additional note (October, 2012):</B></P>

<P>Removing &#8220;to an rvalue,&#8221; as suggested, would have the
effect of negating the preference for binding a function lvalue to an
lvalue reference instead of an rvalue reference because the case would
now fall under the preceding bullet of 13.3.3.2 [over.ics.rank]
paragraph 3 bullet 1, sub-bullets 4 and 5:</P>

<BLOCKQUOTE>

<P>Two implicit conversion sequences of the same form are
indistinguishable conversion sequences unless one of the following
rules applies:</P>

<UL><LI><P>Standard conversion sequence <TT>S1</TT> is a better conversion sequence than
standard conversion sequence <TT>S2</TT> if</P></LI>

<UL><LI><P>...</P></LI>

<LI><P><TT>S1</TT> and <TT>S2</TT> are reference bindings
(8.5.3 [dcl.init.ref]) and neither refers to an implicit object
parameter of a non-static member function declared without a
<I>ref-qualifier</I>, and <TT>S1</TT> binds an rvalue reference to an
rvalue and <TT>S2</TT> binds an lvalue reference... or, if not that,</P></LI>

<LI><P><TT>S1</TT> and <TT>S2</TT> are reference bindings
(8.5.3 [dcl.init.ref]) and <TT>S1</TT> binds an lvalue reference
to a function lvalue and <TT>S2</TT> binds an rvalue reference to a
function lvalue.</P></LI>

</UL>

</UL>

</BLOCKQUOTE>

<P>Presumably if the suggested resolution is adopted, the order of these
two bullets should be inverted.</P>

<BR><BR><HR><A NAME="1827"></A><H4>1827.
  
Reference binding with ambiguous conversions
</H4><B>Section: </B>8.5.3&#160; [dcl.init.ref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-07<BR>




<P>In the following case,</P>

<PRE>
  struct A {
    operator int &amp;&amp;() const;
    operator int &amp;&amp;() volatile;
    operator long();
  };

  int main() {
    int &amp;&amp;x = A();
  }
</PRE>

<P>the conversion for direct binding cannot be used because of
the ambiguity, so indirect binding is used, which allows the
use of the conversion to <TT>long</TT> in creating the temporary.</P>

<P>Is this intended?  There is implementation variation.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG agreed that an ambiguity like this should make the initialization
ill-formed instead of falling through to do indirect binding.</P>

<BR><BR><HR><A NAME="1518"></A><H4>1518.
  
Explicit default constructors and copy-list-initialization
</H4><B>Section: </B>8.5.4&#160; [dcl.init.list]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-08<BR>




<P>Consider the following example:</P>

<PRE>
  struct A {
   explicit A() = default;
  };

  struct B : A {
   explicit B() = default;
  };

  struct C {
   explicit C();
  };

  struct D : A {
   C c;
   explicit D() = default;
  };

  template&lt;typename T&gt; void f() {
   T t = {};
  }
  template&lt;typename T&gt; void g() {
   void x(T t);
   x({});
  }
</PRE>

<P>The question is whether <TT>f&lt;B&gt;</TT>, f<TT>&lt;C&gt;</TT>,
<TT>f&lt;D&gt;</TT>, <TT>g&lt;B&gt;</TT>, <TT>g&lt;C&gt;</TT>, and
<TT>g&lt;D&gt;</TT> are well-formed or ill-formed.
</P>

<P>The crux here is whether 13.3.1.7 [over.match.list] is the
governing law in each of these cases. If it is, the initialization is
ill-formed, because copy-list-initialization has selected an explicit
constructor. The standard seems clear that <TT>f&lt;A&gt;</TT> and
<TT>g&lt;A&gt;</TT> are valid (because <TT>A</TT> is an aggregate, so
13.3.1.7 [over.match.list] is not reached nor applicable),
<TT>f&lt;B&gt;</TT> is valid (because value-initialization does not
call the default constructor, so 13.3.1.7 [over.match.list] is not
reached), and that <TT>g&lt;B&gt;</TT>, <TT>g&lt;C&gt;</TT>, and
<TT>g&lt;D&gt;</TT> are ill-formed (because 13.3.1.7 [over.match.list] is reached from 13.3.3.1.5 [over.ics.list] and
selects an explicit constructor). The difference between
<TT>f&lt;B&gt;</TT> and <TT>g&lt;B&gt;</TT> is troubling.
</P>

<P>For <TT>f&lt;C&gt;</TT> and <TT>f&lt;D&gt;</TT>, it's not clear
whether the default constructor call within value-initialization
within list-initialization uses 13.3.1.7 [over.match.list] &#8212;
but some form of overload resolution seems to be implied, since
presumably we want to apply SFINAE to variadic constructor templates,
diagnose classes which have multiple default constructors through the
addition of default arguments, and the like.
</P>

<P>It has been suggested that perhaps we are supposed to reach
13.3.1.7 [over.match.list] for an empty initializer list for a
non-aggregate class with a default constructor only when we're coming
from 13.3.3.1.5 [over.ics.list], and not when 8.5.4 [dcl.init.list] delegates to value-initialization. That would make all
the <TT>f</TT>s valid, but <TT>g&lt;B&gt;</TT>, <TT>g&lt;C&gt;</TT>,
and <TT>g&lt;D&gt;</TT> ill-formed.
</P>

<P>12.3.1 [class.conv.ctor] paragraph 2 says explicit constructors
are only used for direct-initialization or casts, which argues for at
least <TT>f&lt;C&gt;</TT>, <TT>f&lt;D&gt;</TT>, <TT>g&lt;C&gt;</TT>
and <TT>g&lt;D&gt;</TT> being ill-formed.
</P>



<BR><BR><HR><A NAME="1565"></A><H4>1565.
  
Copy elision and lifetime of <TT>initializer_list</TT> underlying array
</H4><B>Section: </B>8.5.4&#160; [dcl.init.list]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>2012-10-10<BR>




<P>If an <TT>initializer_list</TT> object is copied and the copy
is elided, is the lifetime of the underlying array object extended?
E.g.,</P>

<PRE>
  void f() {
    std::initializer_list&lt;int&gt; L =
        std::initializer_list&lt;int&gt;{1, 2, 3}; //<SPAN style="font-family:Times;font-style:italic"> Lifetime of array extended?</SPAN>
  }
</PRE>

<P>The current wording is not clear.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The consensus of CWG was that the behavior should be the same,
regardless of whether the copy is elided or not.</P>

<BR><BR><HR><A NAME="1496"></A><H4>1496.
  
Triviality with deleted and missing default constructors
</H4><B>Section: </B>9.1&#160; [class.name]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-04-25<BR>




<P>A default constructor that is defined as deleted is trivial, according
to 12.1 [class.ctor] paragraph 5. This means that, according
to 9 [class] paragraph 6, such a class can be trivial.
If, however, the class has no default constructor because it has a
user-declared constructor, the class is not trivial.  Since both cases
prevent default construction of the class, it is not clear why there is
a difference in triviality between the cases.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>It was observed that this issue was related to <A HREF="
     cwg_defects.html#1344">issue 1344</A>, as the current specification allows adding
a default constructor by adding default arguments to the definition of
a constructor.  The resolution of that issue should also resolve this
one.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>It was decided to resolve <A HREF="
     cwg_defects.html#1344">issue 1344</A>
separately from this issue, so this issue now requires its own
resolution.</P>

<BR><BR><HR><A NAME="1341"></A><H4>1341.
  
Bit-field initializers
</H4><B>Section: </B>9.2&#160; [class.mem]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-10<BR>




<P>The grammar for <I>member-declarator</I> (9.2 [class.mem])
does not, but should, allow for a <I>brace-or-equal-initializer</I> on
a bit-field declarator.</P>

<BR><BR><HR><A NAME="1803"></A><H4>1803.
  
<I>opaque-enum-declaration</I> as <I>member-declaration</I>
</H4><B>Section: </B>9.2&#160; [class.mem]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Peter Sommerlad
 &#160;&#160;&#160;

 <B>Date: </B>2013-10-31<BR>




<P>According to 9.2 [class.mem] paragraph 1,</P>

<BLOCKQUOTE>

A member shall not be declared twice in
the <I>member-specification</I>, except that a nested class
or member class template can be declared and then later
defined, and except that an enumeration can be introduced
with an <I>opaque-enum-declaration</I> and later redeclared
with an <I>enum-specifier</I>.

</BLOCKQUOTE>

<P>However, the grammar for <I>member-declaration</I> does not
have a production that allows an <I>opaque-enum-declaration.</I></P>

<BR><BR><HR><A NAME="1890"></A><H4>1890.
  
Member type depending on definition of member function
</H4><B>Section: </B>9.2&#160; [class.mem]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-07<BR>




<P>Consider an example like:</P>

<PRE>
  struct A {
    struct B {
      auto foo() { return 0; }
    };
    decltype(B().foo()) x;
  };
</PRE>

<P>There does not appear to be a prohibition of cases like this, where
the type of a member depends on the definition of a member function.</P>

<P>(See also issues <A HREF="
     cwg_active.html#1360">1360</A> and
<A HREF="
     cwg_defects.html#1397">1397</A>.)</P>

<BR><BR><HR><A NAME="1983"></A><H4>1983.
  
Inappropriate use of <I>virt-specifier</I>
</H4><B>Section: </B>9.2&#160; [class.mem]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-11<BR>


<P>The restriction in 9.2 [class.mem] paragraph 8 that a
<I>virt-specifier</I> may appear only in the declaration of a virtual
function is insufficient to rule out examples like the following:</P>

<PRE>
  struct A { virtual void f(); };
  struct B { friend void A::f() final; };

  template&lt;typename T&gt; struct C { virtual void f() {} };
  template void C&lt;int&gt;::f() final;
  template&lt;&gt; void C&lt;char&gt;::f() final;
</PRE>

<P>One possibility might be to require that a <I>virt-specifier</I>
appear only on the first declaration of a function.</P>

<BR><BR><HR><A NAME="1283"></A><H4>1283.
  
Static data members of classes with typedef name for linkage purposes
</H4><B>Section: </B>9.4.2&#160; [class.static.data]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-29<BR>


<P>According to 9.4.2 [class.static.data] paragraph 4,</P>

<BLOCKQUOTE>

Unnamed classes and classes contained directly or indirectly within
unnamed classes shall not contain static data members.

</BLOCKQUOTE>

<P>There is no such restriction on member functions, and there is
no rationale for this difference, given that both static data members
and member functions can be defined outside a unnamed class with a
typedef name for linkage purposes.  (<A HREF="
     cwg_defects.html#406">Issue 406</A>
acknowledged the lack of rationale by removing the specious note in
9.4.2 [class.static.data] that attempted to explain the restriction
but left the normative prohibition in place.)</P>

<P>It would be more consistent to remove the restriction for classes
with a typedef name for linkage purposes.</P>

<P><B>Additional note (August, 2012):</B></P>

<P>It was observed that, since no definition of a <TT>const</TT>
static data member is required if it is not odr-used, there is no
reason to prohibit such members in an unnamed class even without a
typedef name for linkage purposes. </P>

<BR><BR><HR><A NAME="1721"></A><H4>1721.
  
Diagnosing ODR violations for static data members
</H4><B>Section: </B>9.4.2&#160; [class.static.data]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-31<BR>


<P>Describing the handling of static data members with
<I>brace-or-equal-initializer</I>s, 9.4.2 [class.static.data]
paragraph 3 says,</P>

<BLOCKQUOTE>

The member shall still be defined in a namespace scope if it is odr-used
(3.2 [basic.def.odr]) in the program and the namespace scope
definition shall not contain an initializer.

</BLOCKQUOTE>

<P>The word &#8220;shall&#8221; implies a required diagnostic, but this
is describing an ODR violation (the static data member might be defined
in a different translation unit) and thus should be &#8220;no diagnostic
required.&#8221;</P>

<BR><BR><HR><A NAME="1404"></A><H4>1404.
  
Object reallocation in unions
</H4><B>Section: </B>9.5&#160; [class.union]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-10-19<BR>




<P>According to 9.5 [class.union] paragraph 4,</P>

<BLOCKQUOTE>

<P>[<I>Note:</I> In general, one must use explicit destructor
calls and placement new operators to change the active member of
a union.  &#8212;<I>end note</I>] [<I>Example:</I> Consider an
object <TT>u</TT> of a union type <TT>U</TT> having non-static
data members <TT>m</TT> of type <TT>M</TT> and <TT>n</TT> of type
<TT>N</TT>. If <TT>M</TT> has a non-trivial destructor and
<TT>N</TT> has a non-trivial constructor (for instance, if they
declare or inherit virtual functions), the active member of
<TT>u</TT> can be safely switched from <TT>m</TT> to <TT>n</TT>
using the destructor and placement new operator as follows:</P>

<PRE>
  u.m.~M();
  new (&amp;u.n)  N;
</PRE>

<P>&#8212;<I>end example</I>]</P>

</BLOCKQUOTE>

<P>This pattern is only &#8220;safe&#8221; if the original object
that is being destroyed does not involve any const-qualified or
reference types, i.e., satisfies the requirements of 3.8 [basic.life]
paragraph 7, bullet 3:</P>

<UL><LI><P>the type of the original object is not
const-qualified, and, if a class type, does not contain any
non-static data member whose type is const-qualified or a
reference type</P></LI></UL>

<P>Although paragraph 4 of 9.5 [class.union] is a note and an
example, it should at least refer to the lifetime issues described
in 3.8 [basic.life].</P>

<P><B>Additional note (October, 2013):</B></P>

<P>See also <A HREF="
     cwg_active.html#1776">issue 1776</A>, which suggests
possibly changing the restriction in 3.8 [basic.life].  If
such a change is made, this issue may become moot.</P>

<BR><BR><HR><A NAME="1702"></A><H4>1702.
  
Rephrasing the definition of &#8220;anonymous union&#8221;
</H4><B>Section: </B>9.5&#160; [class.union]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-17<BR>




<P>9.5 [class.union] paragraph 5 defines an anonymous union as
follows:</P>

<BLOCKQUOTE>

<P>A union of the form</P>

<UL><TT>union {</TT> <I>member-specification</I> <TT>} ;</TT></UL>

<P>is called an anonymous union; it defines an unnamed object of unnamed type.</P>

</BLOCKQUOTE>

<P>It is obviously intended that a declaration like</P>

<PRE>
    static union { int i; float f; };
</PRE>

<P>is a declaration of that form (cf paragraph 6, which requires the
<TT>static</TT> keyword for anonymous unions declared in namespace
scope).  However, it would be clearer if the definition were recast
in more descriptive terms, e.g.,</P>

<BLOCKQUOTE>

An <I>anonymous union</I> is an unnamed class that is defined with
the <I>class-key</I> <TT>union</TT> in a <I>simple-declaration</I> in
which the <I>init-declarator-list</I> is omitted.  Such a
<I>simple-declaration</I> is treated as if it contained a single
declarator declaring an unnamed variable of the union's type.

</BLOCKQUOTE>

<P>(Note that this definition would require some additional tweaking to
apply to class member anonymous union declarations, since
<I>simple-declaration</I>s are not included
as <I>member-declaration</I>s.)</P>

<P>As a related point, it is not clear how the following examples
are to be treated, and there is implementation variance on some:</P>

<PRE>
   void f() { thread_local union { int a; }; }
   void g() { extern union { int b; }; }
   thread_local union { int c; }; //<SPAN style="font-family:Times;font-style:italic"> </SPAN>static<SPAN style="font-family:Times;font-style:italic"> is implied by </SPAN>thread_local
   static thread_local union { int d; };
   static const union { int e = 0; }; //<SPAN style="font-family:Times;font-style:italic"> is </SPAN>e<SPAN style="font-family:Times;font-style:italic"> const? Clang says yes, gcc says no</SPAN>
   static constexpr union { int f = 0; };
</PRE>

<BR><BR><HR><A NAME="1801"></A><H4>1801.
  
Kind of expression referring to member of anonymous union
</H4><B>Section: </B>9.5&#160; [class.union]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Majnemer
 &#160;&#160;&#160;

 <B>Date: </B>2013-10-24<BR>


<P>It is not clear whether naming a member of a global anonymous
union should be considered an <I>id-expression</I> or implicitly
a member access expression.  For example, given</P>

<PRE>
  static union {
    int i;
  };

  template &lt;int &amp;&gt; struct S {};
  S&lt;i&gt; V;
</PRE>

<P>is the last line well-formed?  There is implementation variance
on this question.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG agreed that the example should be ill-formed.</P>

<BR><BR><HR><A NAME="1860"></A><H4>1860.
  
What is a &#8220;direct member?&#8221;
</H4><B>Section: </B>9.5&#160; [class.union]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Dawn Perchik
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>


<P>The term &#8220;direct member&#8221; is used in 9.5 [class.union]
paragraph 8 but is not defined.  It might be better to refer to the class's
<I>member-specification</I> instead.</P>

<BR><BR><HR><A NAME="1861"></A><H4>1861.
  
Values of a bit-field
</H4><B>Section: </B>9.6&#160; [class.bit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#1816">issue 1816</A> left many
aspects of bit-fields unspecified, including whether a signed bit field
has a sign bit and the meaning of the bit-field width. Also, the
requirement in 3.9.1 [basic.fundamental] paragraph 1 that</P>

<BLOCKQUOTE>

For narrow character types, all bits of the object representation
participate in the value representation.

</BLOCKQUOTE>

<P>should not apply to oversize character-typed bit-fields.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG decided to address only the issue of oversized bit-fields of
narrow character types at this time, splitting off the more general
questions regarding bit-fields to <A HREF="
     cwg_active.html#1943">issue 1943</A>.</P>

<BR><BR><HR><A NAME="952"></A><H4>952.
  
Insufficient description of &#8220;naming class&#8221;
</H4><B>Section: </B>11.2&#160; [class.access.base]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>7 August, 2009<BR>




<P>The access rules in 11.2 [class.access.base] do not appear to
handle references in nested classes and outside of nonstatic member
functions correctly.  For example,</P>

<PRE>
    struct A {
        typedef int I;    //<SPAN style="font-family:Times;font-style:italic"> public</SPAN>
    };
    struct B: private A { };
    struct C: B {
        void f() {
            I i1;         //<SPAN style="font-family:Times;font-style:italic"> error: access violation</SPAN>
        }
        I i2;             //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
        struct D {
            I i3;         //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
            void g() {
                I i4;     //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
            }
        };
    };
</PRE>

<P>The reason for this discrepancy is that the naming class in
the reference to <TT>I</TT> is different in these cases.  According
to 11.2 [class.access.base] paragraph 5,</P>

<BLOCKQUOTE>

The access to a member is affected by the class in which the member is
named. This naming class is the class in which the member name was
looked up and found.

</BLOCKQUOTE>

<P>In the case of <TT>i1</TT>, the reference to <TT>I</TT> is subject
to the transformation described in 9.3.1 [class.mfct.non-static]
paragraph 3:</P>

<BLOCKQUOTE>

Similarly during name lookup, when an <I>unqualified-id</I>
(5.1 [expr.prim]) used in the definition of a member function
for class <TT>X</TT> resolves to a <TT>static</TT> member, an
enumerator or a nested type of class <TT>X</TT> or of a base class of <TT>X</TT>, the
<I>unqualified-id</I> is transformed into a
<I>qualified-id</I> (5.1 [expr.prim]) in which the
<I>nested-name-specifier</I> names the class of the member function.

</BLOCKQUOTE>

<P>As a result, the reference to <TT>I</TT> in the declaration of
<TT>i1</TT> is transformed to <TT>C::I</TT>, so that the naming class
is <TT>C</TT>, and <TT>I</TT> is inacessible in <TT>C</TT>.  In the
remaining cases, however, the transformation does not apply.  Thus,
the naming class of <TT>I</TT> in these references is <TT>A</TT>, and
<TT>I</TT> is publicly accessible in <TT>A</TT>.</P>

<P>Presumably either the definition of &#8220;naming class&#8221;
must be changed or the transformation of <I>unqualified-id</I>s must
be broadened to include all uses within the scope of a class and not
just within nonstatic member functions (and following the
<I>declarator-id</I> in the definition of a static member, per
9.4 [class.static] paragraph 4).</P>

<BR><BR><HR><A NAME="1699"></A><H4>1699.
  
Does befriending a class befriend its friends?
</H4><B>Section: </B>11.3&#160; [class.friend]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-12<BR>


<P>According to 11.3 [class.friend] paragraph 2,</P>

<BLOCKQUOTE>

Declaring a class to be a friend implies that the names of private and
protected members from the class granting friendship can be accessed in
the <I>base-specifier</I>s and member declarations of the befriended class.

</BLOCKQUOTE>

<P>A <TT>friend</TT> declaration is a <I>member-declaration</I>, but it
is not clear how far the granting of friendship goes in a <TT>friend</TT>
declaration.  For example:</P>

<PRE>
  class c {
    class n {};
    friend struct s;
  };

  struct s {
    friend class c::n;          //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    friend c::n g();            //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
    friend void f() { c::n(); } //<SPAN style="font-family:Times;font-style:italic"> #3</SPAN>
  }; 
</PRE>

<P>In particular, if a friend function is defined inside the class
definition, as in #3, does its definition have access to the private
and protected members of the befriending class?  Implementations vary
on this point.</P>

<BR><BR><HR><A NAME="472"></A><H4>472.
  
Casting across protected inheritance
</H4><B>Section: </B>11.4&#160; [class.protected]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>16 Jun 2004<BR>


<P>Does the restriction in 11.4 [class.protected] apply to
upcasts across protected inheritance, too?  For instance,</P>

<PRE>
    struct B {
        int i;
    };
    struct I: protected B { };
    struct D: I {
        void f(I* ip) {
            B* bp = ip;    // well-formed?
            bp-&gt;i = 5;     // aka "ip-&gt;i = 5;"
        }
    };
</PRE>

<P>I think the rationale for the 11.4 [class.protected]
restriction applies equally well here &#8212; you don't know whether
<TT>ip</TT> points to a <TT>D</TT> object or not, so <TT>D::f</TT> can't be trusted to treat
the protected <TT>B</TT> subobject consistently with the policies of its
actual complete object type.</P>

<P>The current treatment of &#8220;accessible base class&#8221;
in 11.2 [class.access.base] paragraph 4
clearly makes the conversion from <TT>I*</TT> to <TT>B*</TT> well-formed.  I
think that's wrong and needs to be fixed.  The rationale for
the accessibility of a base class is whether &#8220;an invented
public member&#8221; of the base would be accessible at the point of
reference, although we obscured that a bit in the
reformulation; it seems to me that the invented member ought to
be considered a non-static member for this purpose and thus
subject to 11.4 [class.protected].</P>

(See also issues <A HREF="
     cwg_defects.html#385">385</A> and <A HREF="
     cwg_closed.html#471">471</A>.).

<P><B>Notes from October 2004 meeting:</B></P>

<P>The CWG tentatively agreed that casting across protective
inheritance should be subject to the additional restriction in
11.4 [class.protected].</P>



<P><B>Proposed resolution (April, 2011)</B></P>

<P>Change 11.2 [class.access.base] paragraph 4 as follows:</P>

<BLOCKQUOTE>

<P>A base class <TT>B</TT> of <TT>N</TT> is accessible at <I>R</I>, if</P>

<UL><LI><P>an invented public member of <TT>B</TT> would be a public
member of <TT>N</TT>, or</P></LI>

<LI><P><I>R</I> occurs in a member or friend of class <TT>N</TT>, and
an invented public member of <TT>B</TT> would be a private or
protected member of <TT>N</TT>, or</P></LI>

<LI><P><I>R</I> occurs in a member or friend of a class <TT>P</TT>
derived from <TT>N</TT>, and an invented public member of <TT>B</TT>
would be a private <SPAN style="text-decoration:line-through;background-color:#FFA0A0">or</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">(but not a</SPAN> protected
<SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Footnote:</I> A protected invented member is disallowed here
for the same reason the additional check of 11.4 [class.protected]
is applied to member access: it would allow casting a pointer to a
derived class to a protected base class that might be a subobject of
an object of a class that is different from the class context in which
the reference occurs.  &#8212;<I>end footnote</I>])</SPAN> member of
<TT>P</TT>, or</P></LI>

<LI><P>there exists a class <TT>S</TT> such that <TT>B</TT> is a base
class of <TT>S</TT> accessible at <I>R</I> and <TT>S</TT> is a base
class of <TT>N</TT> accessible at <I>R</I>.</P></LI>

</UL>

<P>[<I>Example:</I></P>

<PRE>
    class B {
    public:
      int m;
    };

    class S: private B {
      friend class N;
    };
    class N: private S {
      void f() {
        B* p = this;    // <SPAN style="font-family:Times;font-style:italic">OK because class </SPAN>S<SPAN style="font-family:Times;font-style:italic"> satisfies the fourth condition</SPAN>
                        // <SPAN style="font-family:Times;font-style:italic">above: </SPAN>B<SPAN style="font-family:Times;font-style:italic"> is a base class of </SPAN>N<SPAN style="font-family:Times;font-style:italic"> accessible in </SPAN>f()<SPAN style="font-family:Times;font-style:italic"> because</SPAN>
                        // B<SPAN style="font-family:Times;font-style:italic"> is an accessible base class of </SPAN>S<SPAN style="font-family:Times;font-style:italic"> and </SPAN>S<SPAN style="font-family:Times;font-style:italic"> is an accessible</SPAN>
                        // <SPAN style="font-family:Times;font-style:italic">base class of </SPAN>N.
      }
    };
<SPAN style="font-weight:bold;background-color:#A0FFA0">
    class N2: protected B { };

    class P2: public N2 {
      void f2(N2* n2p) {
        B* bp = n2p;    // <SPAN style="font-family:Times;font-style:italic">error: invented member would be protected and naming</SPAN>
                        // <SPAN style="font-family:Times;font-style:italic">class </SPAN>N2<SPAN style="font-family:Times;font-style:italic"> not the same as or derived from the referencing</SPAN>
                        // <SPAN style="font-family:Times;font-style:italic">class </SPAN>P2
        n2p-&gt;m = 0;     // <SPAN style="font-family:Times;font-style:italic">error (cf 11.4 [class.protected]) for the same reason</SPAN>
      }
    };</SPAN>
</PRE>

<P>&#8212;<I>end example</I>]</P>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1883"></A><H4>1883.
  
Protected access to constructors in <I>mem-initializer</I>s
</H4><B>Section: </B>11.4&#160; [class.protected]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-26<BR>


<P>According to 11.4 [class.protected] paragraph 1, except when
forming a pointer to member,</P>

<BLOCKQUOTE>

All other accesses involve a (possibly implicit) object expression
(5.2.5 [expr.ref]).

</BLOCKQUOTE>

<P>It is not clear that this is strictly true for the invocation of
a base class constructor from a <I>mem-initializer</I>.  A wording
tweak may be advisable.</P>

<BR><BR><HR><A NAME="1353"></A><H4>1353.
  
Array and variant members and deleted special member functions
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Sean Hunt
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-16<BR>




<P>The specification of when a defaulted special member function is to
be defined as deleted sometimes overlooks variant and array members.</P>

<BR><BR><HR><A NAME="1360"></A><H4>1360.
  
<TT>constexpr</TT> defaulted default constructors
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-16<BR>




<P>According to 12.1 [class.ctor] paragraph 6, a defaulted
default constructor is <TT>constexpr</TT> if the corresponding
user-written constructor would satisfy the <TT>constexpr</TT>
requirements.  However, the requirements apply to the definition of
a constructor, and a defaulted constructor is defined only if it is
odr-used, leaving it indeterminate at declaration time whether the
defaulted constructor is <TT>constexpr</TT> or not.</P>

<P>(See also <A HREF="
     cwg_defects.html#1358">issue 1358</A>.)</P>

<P><B>Additional notes (February, 2013):</B></P>

<P>As an example of this issue, consider:</P>

<PRE>
  struct S {
    int i = sizeof(S);
  };
</PRE>

<P>You can't determine the value of the initializer, and thus whether the
initializer is a constant expression, until the class is complete, but you
can't complete the class without declaring the default constructor, and
whether that constructor is <TT>constexpr</TT> or not depends on whether
the member initializer is a constant expression.</P>

<P>A similar issue arises with the following example:</P>

<PRE>
  struct A {
    int x = 37;
    struct B { int x = 37; } b;
    B b2[2][3] = { { } };
  };
</PRE>

<P>This introduces an order dependency that is not specified in the
current text: determining whether the default constructor of <TT>A</TT>
is <TT>constexpr</TT> requires first determining the characteristics of
the initializer of <TT>B::x</TT> and whether <TT>B::B()</TT> is
<TT>constexpr</TT> or not.</P>

<P>The problem is exacerbated with class templates, since the current
direction of CWG is to instantiate member initializers only when they
are needed (see <A HREF="
     cwg_active.html#1396">issue 1396</A>).  For a specific
example:</P>

<PRE>
  struct S;
  template&lt;class T&gt; struct X {
    int i = T().i;
  };
  unsigned n = sizeof(X&lt;S&gt;); //<SPAN style="font-family:Times;font-style:italic"> Error?</SPAN>
  struct S { int i; };
</PRE>

<P>This also affects determining whether a class template specialization
is a literal type or not; presumably getting the right answer to that
requires instantiating the class and all its nonstatic data member
initializers.</P>

<P>See also issues <A HREF="
     cwg_defects.html#1397">1397</A> and <A HREF="
     cwg_active.html#1594">1594</A>.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>This issue should be resolved together with
<A HREF="
     cwg_defects.html#1397">issue 1397</A>.</P>

<P><B>Proposed resolution (May, 2014):</B></P>

<P>Change 12.1 [class.ctor] paragraphs 4-5 as follows:</P>

<BLOCKQUOTE>

<P>A defaulted default constructor for class <TT>X</TT> is defined as
deleted if:</P>

<UL><LI><P>...</P></LI>

<LI><P>any potentially constructed subobject has a type with a destructor
that is deleted or inaccessible from the defaulted default
constructor.</P></LI>

</UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">An implicitly-declared default constructor is <TT>constexpr</TT>
if:</SPAN></P>


<UL><LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>X</TT> has no virtual bases; and</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">for each non-variant non-static data member or base class
subobject <TT>M</TT>, either <TT>M</TT> is initialized via
<I>brace-or-equal-initializer</I> or default-initialization of
<TT>M</TT> uses a <TT>constexpr</TT> constructor; and</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0">if <TT>X</TT> is a union having variant members, or, if
<TT>X</TT> is a non-union-class, for each anonymous union member having
variant members, exactly one non-static data member is initialized via
<I>brace-or-equal-initializer</I>.</SPAN></P></LI>

</UL>

<P>A default constructor is trivial if it is not user-provided and if:</P>

<UL><LI><P>...</P></LI>

<LI><P>for all the non-static data members of its class that are of class
type (or array thereof), each such class has a trivial default
constructor.</P></LI>

</UL>

<P>Otherwise, the default constructor is <I>non-trivial</I>.</P>

<P>A default constructor that is defaulted and not defined as deleted is
<I>implicitly defined</I> when it is odr-used (3.2 [basic.def.odr]) to
create an object of its class type (1.8 [intro.object]) or when it is
explicitly defaulted after its first declaration.  The implicitly-defined
default constructor performs the set of initializations of the class that
would be performed by a user-written default constructor for that class
with no <I>ctor-initializer</I> (12.6.2 [class.base.init]) and an
empty <I>compound-statement</I>. If that user-written default constructor
would be ill-formed, the program is ill-formed.  <SPAN style="text-decoration:line-through;background-color:#FFA0A0">If that user-written
default constructor would satisfy the requirements of a <TT>constexpr</TT>
constructor (7.1.5 [dcl.constexpr]), the implicitly-defined default
constructor is <TT>constexpr</TT>.</SPAN> Before the defaulted default
constructor for a class is implicitly defined, all the non-user-provided
default constructors for its base classes and its non-static data members
shall have been implicitly defined. [<I>Note:</I>...</P>

</BLOCKQUOTE>

<P><B>Additional notes, May, 2014:</B></P>

<P>The proposed resolution inadvertently allows a defaulted default
constructor of a class with virtual bases to be <TT>constexpr</TT>.
It has been updated with a change addressing that oversight and
returned to "review" status.</P>

<P>See also <A HREF="
     cwg_active.html#1890">issue 1890</A>.</P>

<BR><BR><HR><A NAME="1623"></A><H4>1623.
  
Deleted default union constructor and member initializers
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Vinny Romano
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-15<BR>




<P>According to 12.1 [class.ctor] paragraph 5,</P>

<BLOCKQUOTE>

<P>A defaulted default constructor for class <TT>X</TT> is defined as
deleted if:</P>

<UL><LI><P><TT>X</TT> is a union-like class that has a variant member with
a non-trivial default constructor,</P></LI>

<LI><P>...</P></LI>

<LI><P><TT>X</TT> is a union and all of its variant members are of
const-qualified type (or array thereof),</P></LI>

<LI><P><TT>X</TT> is a non-union class and all members of any anonymous
union member are of const-qualified type (or array thereof),</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>Because the presence of a non-static data member initializer is the
moral equivalent of a <I>mem-initializer</I>, these rules should
probably be modified not to define the generated constructor as
deleted when a union member has a non-static data member initializer.
(Note the non-normative references in 9.5 [class.union]
paragraphs 2-3 and 7.1.6.1 [dcl.type.cv] paragraph 2 that
would also need to be updated if this restriction is changed.)</P>

<P>It would also be helpful to add a requirement to 9.5 [class.union]
requiring either a non-static data member initializer or a user-provided
constructor if all the members of the union have const-qualified types.</P>

<P>On a more general note, why is the default constructor defined as
deleted just because a member has a non-trivial default constructor?  The
union itself doesn't know which member is the active one, and default
construction won't initialize any members (assuming
no <I>brace-or-equal-initializer</I>).  It is up to the &#8220;owner&#8221;
of the union to control the lifetime of the active member (if any), and
requiring a user-provided constructor is forcing a design pattern that
doesn't make sense.  Along the same lines, why is the default destructor
defined as deleted just because a member has a non-trivial destructor?  I
would agree with this restriction if it only applied when the union also
has a user-provided constructor.</P>

<P>See also issues <A HREF="
     cwg_defects.html#1460">1460</A>,
<A HREF="
     cwg_defects.html#1562">1562</A>, <A HREF="
     cwg_defects.html#1587">1587</A>,
and <A HREF="
     cwg_active.html#1621">1621</A>.</P>


<BR><BR><HR><A NAME="1299"></A><H4>1299.
  
&#8220;Temporary objects&#8221; vs &#8220;temporary expressions&#8221;
</H4><B>Section: </B>12.2&#160; [class.temporary]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-16<BR>




<P>The Standard is insufficiently precise in dealing with temporaries.
It is not always clear when the term &#8220;temporary&#8221; is referring
to an expression whose result is a prvalue and when it is referring to
a temporary object.</P>

<P>(See also <A HREF="
     cwg_closed.html#1568">issue 1568</A>.)</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>The resolution is contained in document N3918.</P>

<P>This resolution also resolves issues <A HREF="
     cwg_active.html#1651">1651</A>
and <A HREF="
     cwg_active.html#1893">1893</A>.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>Concerns have been raised  that the meaning of
&#8220;corresponding temporary object&#8221; is not clear enough
in the proposed wording.  In addition, N3918 says that it
resolves <A HREF="
     cwg_closed.html#1300">issue 1300</A>, but that issue
is 1) marked as a duplicate of <A HREF="
     cwg_closed.html#914">issue 914</A>
and 2) the subject of continuing deliberations in EWG.  This
issue is being returned to "review" status to allow CWG to
address these concerns.</P>

<BR><BR><HR><A NAME="1651"></A><H4>1651.
  
Lifetime extension of temporary via reference to subobject
</H4><B>Section: </B>12.2&#160; [class.temporary]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-15<BR>


<P>The resolution of issues <A HREF="
     cwg_defects.html#616">616</A> and
<A HREF="
     cwg_defects.html#1213">1213</A>, making the result of a member access or
subscript expression applied to a prvalue an xvalue, means that binding a
reference to such a subobject of a temporary does not extend the
temporary's lifetime. 12.2 [class.temporary] should be revised to ensure
that it does.</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="
     cwg_active.html#1299">issue 1299</A>.</P>

<BR><BR><HR><A NAME="1697"></A><H4>1697.
  
Lifetime extension and copy elision
</H4><B>Section: </B>12.2&#160; [class.temporary]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-01<BR>




<P>In an example like,</P>

<PRE>
  struct S { ~S(); };
  struct X { X(); X(const X&amp;); };
  struct T { S &amp;&amp;s; X x; };
  void f();
  void g() { T t = T{ {}, {} }; f(); }
</PRE>

<P>it appears that the current wording allows two ways of handling
this:</P>

<OL><LI><P>The copy to <TT>t</TT> in <TT>g</TT> is not elided. <TT>X(const
X&amp;)</TT> is called, then <TT>~S()</TT> is called, then <TT>f()</TT> is
called.</P></LI>

<LI>The copy to <TT>t</TT> in <TT>g</TT> is elided, so the temporary
and <TT>t</TT> are the same object. Thus, the <TT>S</TT> object's lifetime
is extended to the lifetime of the reference <TT>t.s</TT>, so
first <TT>f()</TT> is called, then <TT>~S()</TT> is called (and <TT>X(const
X&amp;)</TT> is not called).</LI>

</OL>

<P>However, EDG and g++ produce a third behavior: they do not call
<TT>X(const X&amp;)</TT>, but they destroy the <TT>S()</TT> temporary at
the end of its full-expression. The current wording does not appear to
permit this behavior, but it seems preferable that lifetime extension does
not depend on whether copy elision is done.</P>

<BR><BR><HR><A NAME="1726"></A><H4>1726.
  
Declarator operators and conversion function
</H4><B>Section: </B>12.3.2&#160; [class.conv.fct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-02<BR>




<P>Presumably the following example is intended to be ill-formed:</P>

<PRE>
  struct A {
    (*operator int*());
  };
  A a;
  int *x = a; //<SPAN style="font-family:Times;font-style:italic"> Ok?</SPAN>
</PRE>

<P>It is not clear, however, which rule is supposed to reject such a
<I>member-declaration</I>.</P>

<BR><BR><HR><A NAME="2016"></A><H4>2016.
  
Confusing wording in description of conversion function
</H4><B>Section: </B>12.3.2&#160; [class.conv.fct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-05<BR>


<P>The statement in 12.3.1 [class.conv.ctor] paragraph 1,</P>

<BLOCKQUOTE>

No return type can be specified.

</BLOCKQUOTE>

<P>is confusing, since a conversion operator has a return type.  It
would be more precise to phrase the restriction in terms of the
permissible <I>decl-specifier</I>s in the function's
<I>decl-specifier-seq</I>.  The next sentence is also problematic,</P>

<BLOCKQUOTE>

If a conversion function is a member function, the
type of the conversion function (8.3.5 [dcl.fct])
is &#8220;function taking no parameter
returning <I>conversion-type-id</I>&#8221;.

</BLOCKQUOTE>

<P>as it implies that a conversion function might not be a member
function.</P>

<BR><BR><HR><A NAME="399"></A><H4>399.
  
Destructor lookup redux
</H4><B>Section: </B>12.4&#160; [class.dtor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>17 Jan 2003<BR>


<P>Mark Mitchell raised a number of issues related to the resolution of
<A HREF="
     cwg_defects.html#244">issue 244</A> and of destructor lookup in general.</P>

<P><A HREF="
     cwg_defects.html#244">Issue 244</A> says:</P>
<BLOCKQUOTE>
	... in a <I>qualified-id</I> of the form:
<UL>
::<SUB>opt</SUB> <I>nested-name-specifier</I><SUB>opt</SUB>
   <I>class-name</I> :: ~ <I>class-name</I>
</UL>
	the second class-name is looked up in the same scope as the first.
</BLOCKQUOTE>
<P>But if the reference is "<TT>p-&gt;X::~X()</TT>", the first
<I>class-name</I> is looked up
in two places (normal lookup and a lookup in the class of p).  Does
the new wording mean:
<OL>
<LI>
You look up the second class-name in the scope that you found the first
one.
</LI>
<LI>You look up the second class-name using the same kind of lookup that
   found the first one (normal vs. class).
</LI>
<LI>If you did a dual lookup for the first you do a dual lookup for the
   second.
</LI>
</OL>
</P>

<P>This is a test case that illustrates the issue:</P>
<PRE>
  struct A {
    typedef A C;
  };

  typedef A B;

  void f(B* bp) {
    bp-&gt;B::~B();  // okay B found by normal lookup
    bp-&gt;C::~C();  // okay C found by class lookup
    bp-&gt;B::~C();  // B found by normal lookup C by class -- okay?
    bp-&gt;C::~B();  // C found by class lookup B by normal -- okay?
  }
</PRE>

<P>A second issue concerns destructor references when the class involved is
a template class.</P>
<PRE>
  namespace N {
    template &lt;typename T&gt; struct S {
      ~S();
    };
  }

  void f(N::S&lt;int&gt;* s) {
    s-&gt;N::S&lt;int&gt;::~S();
  }
</PRE>
<P>The issue here is that the grammar uses "~<I>class-name</I>" for destructor
names, but in this case S is a template name when looked up in N.</P>

<P>Finally, what about cases like:</P>
<PRE>
  template &lt;typename T&gt; void f () {
    typename T::B x;
    x.template A&lt;T&gt;::template B&lt;T&gt;::~B();
  }
</PRE>
<P>When parsing the template definition, what checks can be done on "~B"?</P>

<P><U>Sandor Mathe</U> adds
:</P>

<P>The standard correction for <A HREF="
     cwg_defects.html#244">issue 244</A>
(now in DR status) is still incomplete.</P>

<P>Paragraph 5 of 3.4.3 [basic.lookup.qual] is
not applicable for p-&gt;T::~T since there is no nested-name-specifier.
Section 3.4.5 [basic.lookup.classref]
describes the lookup of p-&gt;~T but p-&gt;T::~T is still not
described.  There are examples (which are non-normative) that illustrate
this sort of lookup but they still leave questions unanswered.  The
examples imply that the name after ~ should be looked up in the same
scope as the name before the :: but it is not stated.  The problem is
that the name to the left of the :: can be found in two
different scopes.  Consider the following:</P>
<PRE>
  struct S {
    struct C { ~C() { } };
  };

  typedef S::C D;

  int main() {
    D* p;
    p-&gt;C::~D();  // valid?
  }
</PRE>

<P>Should the destructor call be valid?  If there were a nested name
specifier, then D should be looked for in the same scope as C.  But
here, C is looked for in 2 different ways.  First, it is searched for in
the type of the left hand side of -&gt; and it is also looked for in the
lexical context.  It is found in one or if both, they must match.  So, C
is found in the scope of what p points at.  Do you only look for D there?
If so, this is invalid.  If not, you would then look for D in the context
of the expression and find it.  They refer to the same underlying
destructor so this is valid.  The intended resolution of the original
defect report of the standard was that the name before the :: did not
imply a scope and you did not look for D inside of C.  However, it was
not made clear whether this was to be resolved by using the same lookup
mechanism or by introducing a new form of lookup which is to look in the
left hand side if that is where C was found, or in the context of the
expression if that is where C was found.  Of course, this begs the
question of what should happen when it is found in both?  Consider
the modification to the above case when C is also found in the context
of the expression.  If you only look where you found C, is this now
valid because it is in 1 of the two scopes or is it invalid because C
was in both and D is only in 1?</P>

<PRE>
  struct S {
    struct C { ~C() { } };
  };

  typedef S::C D;
  typedef S::C C;

  int main() {
    D* p;
    p-&gt;C::~D();  // valid?
  }
</PRE>

<P>I agree that the intention of the committee is that the original test
case in this defect is broken.  The standard committee clearly thinks
that the last name before the last :: does not induce a new scope which
is our current interpretation.  However, how this is supposed to work
is not defined.  This needs clarification of the standard.</P>

<P><U>Martin Sebor</U> adds this example (September 2003), along
with errors produced by the EDG front end:</P>
<PRE>
namespace N {
    struct A { typedef A NA; };
    template &lt;class T&gt; struct B { typedef B NB; typedef T BT; };
    template &lt;template &lt;class&gt; class T&gt; struct C { typedef C NC; typedef T&lt;A&gt; CA; };
}

void foo (N::A *p)
{
    p-&gt;~NA ();
    p-&gt;NA::~NA ();
}

template &lt;class T&gt;
void foo (N::B&lt;T&gt; *p)
{
    p-&gt;~NB ();
    p-&gt;NB::~NB ();
}

template &lt;class T&gt;
void foo (typename N::B&lt;T&gt;::BT *p)
{
    p-&gt;~BT ();
    p-&gt;BT::~BT ();
}

template &lt;template &lt;class&gt; class T&gt;
void foo (N::C&lt;T&gt; *p)
{
    p-&gt;~NC ();
    p-&gt;NC::~NC ();
}

template &lt;template &lt;class&gt; class T&gt;
void foo (typename N::C&lt;T&gt;::CA *p)
{
    p-&gt;~CA ();
    p-&gt;CA::~CA ();
}

Edison Design Group C/C++ Front End, version 3.3 (Sep  3 2003 11:54:55)
Copyright 1988-2003 Edison Design Group, Inc.

"t.cpp", line 16: error: invalid destructor name for type "N::B&lt;T&gt;"
      p-&gt;~NB ();
          ^

"t.cpp", line 17: error: qualifier of destructor name "N::B&lt;T&gt;::NB" does not
          match type "N::B&lt;T&gt;"
      p-&gt;NB::~NB ();
              ^

"t.cpp", line 30: error: invalid destructor name for type "N::C&lt;T&gt;"
      p-&gt;~NC ();
          ^

"t.cpp", line 31: error: qualifier of destructor name "N::C&lt;T&gt;::NC" does not
          match type "N::C&lt;T&gt;"
      p-&gt;NC::~NC ();
              ^

4 errors detected in the compilation of "t.cpp".
</PRE>

<P><U>John Spicer:</U>
The issue here is that we're unhappy with the destructor names when doing 
semantic analysis of the template definitions (not during an
instantiation).</P>

<P>My personal feeling is that this is reasonable.  After all, why 
would you call p-&gt;~NB for a class that you just named
as N::B&lt;T&gt; and you could just say p-&gt;~B?</P>

<P><B>Additional note (September, 2004)</B></P>

<P>The resolution for <A HREF="
     cwg_defects.html#244">issue 244</A> removed
the discussion of <TT>p-&gt;N::~S</TT>, where <TT>N</TT> is a
<I>namespace-name</I>.  However, the resolution did not make this
construct ill-formed; it simply left the semantics undefined.
The meaning should either be defined or the construct made
ill-formed.</P>

<P>See also issues <A HREF="
     cwg_defects.html#305">305</A> and
<A HREF="
     cwg_defects.html#466">466</A>.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>Here are some additional examples that should be addressed by the
resolution of this issue:</P>

<PRE>
   namespace N {
     template&lt;typename T&gt; struct E {};
     typedef E&lt;int&gt; F;
   }
   namespace M {
     typedef N::F H;
   }
   void g(N::F f) {
     typedef N::F G;
     f.G::~E(); //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
     f.G::~F(); //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
     f.G::~G(); //<SPAN style="font-family:Times;font-style:italic"> #3</SPAN>
     f.N::F::~E(); //<SPAN style="font-family:Times;font-style:italic"> #4</SPAN>
     f.N::F::~F(); //<SPAN style="font-family:Times;font-style:italic"> #5</SPAN>
     f.N::F::~G(); //<SPAN style="font-family:Times;font-style:italic"> #6</SPAN>
     f.M::H::~E(); //<SPAN style="font-family:Times;font-style:italic"> #7</SPAN>
     f.M::H::~F(); //<SPAN style="font-family:Times;font-style:italic"> #8</SPAN>
     f.M::H::~G(); //<SPAN style="font-family:Times;font-style:italic"> #9</SPAN>
     f.M::H::~H(); //<SPAN style="font-family:Times;font-style:italic"> #10</SPAN>
   }
</PRE>



<BR><BR><HR><A NAME="1977"></A><H4>1977.
  
Contradictory results of failed destructor lookup
</H4><B>Section: </B>12.4&#160; [class.dtor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-21<BR>




<P>According to 12.4 [class.dtor] paragraph 12,</P>

<BLOCKQUOTE>

At the point of definition of a virtual destructor (including an implicit
definition (12.8 [class.copy])), the non-array deallocation
function is looked up in the scope of the destructor's class
(10.2 [class.member.lookup]), and, if no declaration is found, the function
is looked up in the global scope. If the result of this lookup is ambiguous
or inaccessible, or if the lookup selects a placement deallocation function
or a function with a deleted definition (8.4 [dcl.fct.def]), the
program is ill-formed. [<I>Note:</I> This assures that a deallocation
function corresponding to the dynamic type of an object is available for
the <I>delete-expression</I> (12.5 [class.free]). &#8212;<I>end
note</I>]

</BLOCKQUOTE>

<P>However, bullet 5.3 of that section says that such a lookup failure
causes the destructor to be defined as deleted, rather than making the
program ill-formed.  It appears that paragraph 12 was overlooked when
deleted functions were added to the language.  See also
12.5 [class.free] paragraph 7.</P>

<BR><BR><HR><A NAME="255"></A><H4>255.
  
Placement deallocation functions and lookup ambiguity
</H4><B>Section: </B>12.5&#160; [class.free]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>26 Oct 2000<BR>


<P>Paragraph 4 of 12.5 [class.free] speaks of looking up a
deallocation function.  While it is an error if a placement
deallocation function alone is found by this lookup, there seems to be
an assumption that a placement deallocation function and a usual
deallocation function can both be declared in a given class scope
without creating an ambiguity.  The normal mechanism by which
ambiguity is avoided when functions of the same name are declared in
the same scope is overload resolution; however, there is no mention of
overload resolution in the description of the lookup.  In fact, there
appears to be nothing in the current wording that handles this case.
That is, the following example appears to be ill-formed, according to
the current wording:</P>

<PRE>
    struct S {
        void operator delete(void*);
        void operator delete(void*, int);
    };
    void f(S* p) {
        delete p;    // ill-formed: ambiguous operator delete
    }
</PRE>

<P><B>Suggested resolution</B> (Mike Miller, March 2002):</P>

<P>I think you might get the right effect by replacing
the last sentence of 12.5 [class.free] paragraph 4
with something like:</P>
<BLOCKQUOTE>
After removing all placement deallocation functions,
the result of the lookup shall contain an unambiguous
and accessible deallocation function.
</BLOCKQUOTE>

<P><B>Additional notes (October, 2012):</B></P>

<P>This issue should be reconsidered in list of paper N3396, as it would
add additional overloads for allocation and deallocation functions.

</P>

<P>The term &#8220;usual deallocation function&#8221; is defined in
3.7.4.2 [basic.stc.dynamic.deallocation] paragraph 2; perhaps it could be used to
good effect in 5.3.5 [expr.delete] paragraph 7.  The specifications
in 12.5 [class.free] paragraphs 4 and 5 should probably also be
moved into 5.3.5 [expr.delete].</P>

<BR><BR><HR><A NAME="1621"></A><H4>1621.
  
Member initializers in anonymous unions
</H4><B>Section: </B>12.6.2&#160; [class.base.init]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-12<BR>


<P>The effect of a non-static data member initializer in an anonymous
union is not clearly described in the current wording.  Consider the
following example:</P>

<PRE>
  struct A {
    struct B {
      union {
        int x = 37;
      };
      union {
        int y = x + 47;  //<SPAN style="font-family:Times;font-style:italic"> Well-formed?</SPAN>
      };
    } a;
  }; 
</PRE>

<P>Does an anonymous union have a constructor that applies a non-static
data member initializer?  Or is the initialization performed by the
constructor of the class in which the anonymous union appears?  In
particular, is the reference to <TT>x</TT> in the initializer for
<TT>y</TT> well-formed or not?  If the initialization of <TT>y</TT>
is performed by <TT>B</TT>'s constructor, there is no problem because
<TT>B::x</TT> is a member of the object being initialized.  If an anonymous
union has its own constructor, <TT>B::x</TT> is just a member of the
containing class and is a reference to a non-static data member without an
object, which is ill-formed.  Implementations currently appear to take the
latter interpretation and report an error for that initializer.</P>



<P>As a further example, consider:</P>

<PRE>
  union {       //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    union {     //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
      union {   //<SPAN style="font-family:Times;font-style:italic"> #3</SPAN>
        int y = 32;
      };
    };
  } a { } ;
</PRE>

<P>One interpretation might be that union #3 has a non-trivial default
constructor because of the initializer of <TT>y</TT>, which would give
union #2 a deleted default constructor, which would make the example
ill-formed.</P>

<P>As yet another example, consider:</P>

<PRE>
  union {
    union {
      int x;
    };
    union {
      int y = 3;
    };
    union {
      int z;
    };
  } a { };
</PRE>

<P>Assuming the current proposed resolution of <A HREF="
     cwg_defects.html#1502">issue 1502</A>, what is the correct interpretation of this code?  Is it
well-formed, and if so, what initialization is performed?</P>

<P>Finally, consider</P>

<PRE>
  struct S {
    union { int x = 1; };
    union { int y = 2; };
  } s{};
</PRE>

<P>Does this violate the prohibition of aggregates containing
member initializers in 8.5.1 [dcl.init.aggr] paragraph 1?</P>

<P>See also issues <A HREF="
     cwg_defects.html#1460">1460</A>,
<A HREF="
     cwg_defects.html#1562">1562</A>, <A HREF="
     cwg_defects.html#1587">1587</A>,
and <A HREF="
     cwg_active.html#1623">1623</A>.</P>

<BR><BR><HR><A NAME="1517"></A><H4>1517.
  
Unclear/missing description of behavior during construction/destruction
</H4><B>Section: </B>12.7&#160; [class.cdtor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-07<BR>


<P>The current wording of 12.7 [class.cdtor] paragraph 4 does
not describe the behavior of calling a virtual function in a
<I>mem-initializer</I> for a base class, only for a non-static data
member.  Also, the changes for <A HREF="
     cwg_defects.html#1202">issue 1202</A>
should have been, but were not, applied to the description of the
behavior of <TT>typeid</TT> and <TT>dynamic_cast</TT> in paragraphs 5
and 6.</P>

<P>In addition, the resolution of <A HREF="
     cwg_defects.html#597">issue 597</A>
allowing the out-of-lifetime conversion of pointers/lvalues to
non-virtual base classes, should have been, but were not, applied to
paragraph 3.</P>

<P><B>Proposed resolution (August, 2013):</B></P>

<OL><LI><P>Change 12.7 [class.cdtor] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

For an object with a non-trivial constructor, referring to any
non-static member or <SPAN style="font-weight:bold;background-color:#A0FFA0">virtual</SPAN> base class of the object
before the constructor begins execution results in undefined behavior.
For an object with a non-trivial destructor, referring to any
non-static member or <SPAN style="font-weight:bold;background-color:#A0FFA0">virtual</SPAN> base class of the object after
the destructor finishes execution results in undefined
behavior. [<I>Example:</I>

<PRE>
  struct X { int i; };
  struct Y : X { Y(); };                       //<SPAN style="font-family:Times;font-style:italic"> non-trivial</SPAN>
  struct A { int a; };
  struct B : <SPAN style="text-decoration:line-through;background-color:#FFA0A0">public</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">virtual</SPAN> A { int j; Y y; }; //<SPAN style="font-family:Times;font-style:italic"> non-trivial</SPAN>

  extern B bobj;
  B* pb = &amp;bobj;                               //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
  int* p1 = &amp;bobj.a;                           //<SPAN style="font-family:Times;font-style:italic"> undefined, refers to base class member</SPAN>
  int* p2 = &amp;bobj.y.i;                         //<SPAN style="font-family:Times;font-style:italic"> undefined, refers to member's member</SPAN>

  A* pa = &amp;bobj;                               //<SPAN style="font-family:Times;font-style:italic"> undefined, upcast to a <SPAN style="font-weight:bold;background-color:#A0FFA0">virtual</SPAN> base class type</SPAN>
  B bobj;                                      //<SPAN style="font-family:Times;font-style:italic"> definition of </SPAN>bobj

  extern X xobj;
  int* p3 = &amp;xobj.i;                           //<SPAN style="font-family:Times;font-style:italic">OK, </SPAN>X<SPAN style="font-family:Times;font-style:italic"> is a trivial class</SPAN>
  X xobj;
</PRE>

</BLOCKQUOTE>

<LI><P>Change 12.7 [class.cdtor] paragraphs 3-6 as follows:</P></LI>

<BLOCKQUOTE>

<P>To explicitly or implicitly convert a pointer (a glvalue) referring to
an object of class <TT>X</TT> to a pointer (reference) to a direct or
indirect <SPAN style="font-weight:bold;background-color:#A0FFA0">virtual</SPAN> base class <TT>B</TT> of <TT>X</TT>, the
construction of <TT>X</TT> and the construction of all of its direct or
indirect bases <SPAN style="text-decoration:line-through;background-color:#FFA0A0">that directly or indirectly derive from</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">for which</SPAN> <TT>B</TT> <SPAN style="font-weight:bold;background-color:#A0FFA0">is a direct or indirect virtual
base</SPAN> shall have started and the destruction of these classes
shall not have completed, otherwise the conversion results in
undefined behavior. To form a pointer to (or access the value of) a
direct non-static member...</P>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">Member functions, including virtual functions
(10.3 [class.virtual]), can be called during construction or
destruction (12.6.2 [class.base.init]).  When a virtual function is
called directly or indirectly from a constructor or from a destructor,
including during the construction or destruction of the class's non-static
data members, and the object to which the call applies is the object (call
it <TT>x</TT>) under construction or destruction, the function called is
the final overrider in the constructor's or destructor's class and not one
overriding it in a more-derived class.  If the virtual function call uses
an explicit class member access (5.2.5 [expr.ref]) and the object
expression refers to the complete object of x or one of that object's base
class subobjects but not to <TT>x</TT> or one of its base class subobjects,
the behavior is undefined.</SPAN>

<SPAN style="font-weight:bold;background-color:#A0FFA0">The <I>period of construction</I> of an object or subobject whose type
is a class type <TT>C</TT> begins immediately after the construction of all
its base class subobjects is complete and concludes when the last
constructor of class <TT>C</TT> exits.  The <I>period of destruction</I> of
an object or subobject whose type is a class type <TT>C</TT> begins when
the destructor for <TT>C</TT> begins execution and concludes immediately
before beginning the destruction of its base class
subobjects. A <I>polymorphic operation</I> is a virtual function call
(5.2.2 [expr.call]), the <TT>typeid</TT> operator
(5.2.8 [expr.typeid]) when applied to a glvalue of polymorphic type,
or the <TT>dynamic_cast</TT> operator (5.2.7 [expr.dynamic.cast]) when
applied to a pointer to or glvalue of a polymorphic type. A <I>polymorphic
operand</I> is the object expression in a virtual function call or the
operand of a polymorphic <TT>typeid</TT>
or <TT>dynamic_cast</TT>.</SPAN></P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0"> During the period of construction or period of destruction of
an object or subobject whose type is a class type <TT>C</TT> (call
it <TT>x</TT>), the effect of performing a polymorphic operation in
which the polymorphic operand designates <TT>x</TT> or a base class
subobject thereof is as if the dynamic type of the object were
class <TT>C</TT>.  [<I>Footnote:</I> This is true even if <TT>C</TT>
is an abstract class, which cannot be the type of a most-derived
object. &#8212;<I>end footnote</I>] If a polymorphic operand refers to
an object or subobject having class type <TT>C</TT> before its period
of construction begins or after its period of destruction is complete,
the behavior is undefined. [<I>Note:</I> This includes the evaluation
of an expression appearing in a <I>mem-initializer</I> of <TT>C</TT>
in which the <I>mem-initializer-id</I> designates <TT>C</TT> or one of
its base classes. &#8212;<I>end note</I>]</SPAN> [<I>Example:</I></P>

<PRE>
  struct V {
<SPAN style="font-weight:bold;background-color:#A0FFA0">    V();
    V(int);</SPAN>
    virtual void f();
    virtual void g();
  };

  struct A : virtual V {
    virtual void f();
<SPAN style="font-weight:bold;background-color:#A0FFA0">    virtual int h();
    A() : V(h()) { }     //<SPAN style="font-family:Times;font-style:italic"> undefined behavior: virtual function </SPAN>h<SPAN style="font-family:Times;font-style:italic"> called</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> before </SPAN>A<SPAN style="font-family:Times;font-style:italic">'s period of construction begins</SPAN></SPAN>
  };

  struct B : virtual V {
    virtual void g();
    B(V*, A*);
  };

  struct D : A, B {
    virtual void f();
    virtual void g();
    D() : B((A*)this, this) { }
  };

  B::B(V* v, A* a) {
    f();                 //<SPAN style="font-family:Times;font-style:italic"> calls </SPAN>V::f<SPAN style="font-family:Times;font-style:italic">, not </SPAN>A::f
    g();                 //<SPAN style="font-family:Times;font-style:italic"> calls </SPAN>B::g<SPAN style="font-family:Times;font-style:italic">, not </SPAN>D::g
    v-&gt;g();              //<SPAN style="font-family:Times;font-style:italic"> </SPAN>v<SPAN style="font-family:Times;font-style:italic"> is base of </SPAN>B<SPAN style="font-family:Times;font-style:italic">, the call is well-defined, calls </SPAN>B::g
    a-&gt;f();              //<SPAN style="font-family:Times;font-style:italic"> undefined behavior, </SPAN>a<SPAN style="font-family:Times;font-style:italic">'s type not a base of </SPAN>B
<SPAN style="font-weight:bold;background-color:#A0FFA0">    typeid(*this);       //<SPAN style="font-family:Times;font-style:italic"> </SPAN>type_info<SPAN style="font-family:Times;font-style:italic"> for </SPAN>B
    typeid(*v);          //<SPAN style="font-family:Times;font-style:italic"> well-defined: </SPAN>*v<SPAN style="font-family:Times;font-style:italic"> has type </SPAN>V<SPAN style="font-family:Times;font-style:italic">, a base of </SPAN>B<SPAN style="font-family:Times;font-style:italic">,</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> so its period of construction is complete;</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> yields </SPAN>type_info<SPAN style="font-family:Times;font-style:italic"> for </SPAN>B
    typeid(*a);          //<SPAN style="font-family:Times;font-style:italic"> undefined behavior: </SPAN>A<SPAN style="font-family:Times;font-style:italic"> is not a base of </SPAN>B<SPAN style="font-family:Times;font-style:italic">,</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> so its period of construction has not begun</SPAN>
    dynamic_cast&lt;B*&gt;(v); //<SPAN style="font-family:Times;font-style:italic"> well-defined: </SPAN>v<SPAN style="font-family:Times;font-style:italic"> has type </SPAN>V*<SPAN style="font-family:Times;font-style:italic">, </SPAN>V<SPAN style="font-family:Times;font-style:italic"> is a base of </SPAN>B<SPAN style="font-family:Times;font-style:italic">,</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> so its period of construction is complete;</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> results in </SPAN>this
    dynamic_cast&lt;B*&gt;(a); //<SPAN style="font-family:Times;font-style:italic"> undefined behavior: </SPAN>A<SPAN style="font-family:Times;font-style:italic"> is not a base of </SPAN>B<SPAN style="font-family:Times;font-style:italic">,</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> so its period of construction has not begun</SPAN></SPAN>
  }
</PRE>

<P>&#8212;<I>end example</I>]</P>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">The <TT>typeid</TT> operator (5.2.8 [expr.typeid]) can be
used during construction or destruction
(12.6.2 [class.base.init]). When <TT>typeid</TT> is used in a
constructor (including the <I>mem-initializer</I> or
<I>brace-or-equal-initializer</I> for a non-static data member) or in a
destructor, or used in a function called (directly or indirectly) from a
constructor or destructor, if the operand of <TT>typeid</TT> refers to the
object under construction or destruction,
<TT>typeid</TT> yields the <TT>std::type_info</TT> object representing
the constructor or destructor's class. If the operand of
<TT>typeid</TT> refers to the object under construction or destruction
and the static type of the operand is neither the constructor or
destructor's class nor one of its bases, the result of <TT>typeid</TT>
is undefined.</SPAN>
</P>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>dynamic_cast</TT>s (5.2.7 [expr.dynamic.cast]) can be used
during construction or destruction (12.6.2 [class.base.init]).  When
a <TT>dynamic_cast</TT> is used in a constructor (including
the <I>mem-initializer</I> or <I>brace-or-equal-initializer</I> for a
non-static data member) or in a destructor, or used in a function called
(directly or indirectly) from a constructor or destructor, if the operand
of the <TT>dynamic_cast</TT> refers to the object under construction or
destruction, this object is considered to be a most derived object that has
the type of the constructor or destructor's class. If the operand of
the <TT>dynamic_cast</TT> refers to the object under construction or
destruction and the static type of the operand is not a pointer to or
object of the constructor or destructor's own class or one of its bases,
the <TT>dynamic_cast</TT> results in undefined behavior.
[<I>Example:</I></SPAN>
</P>

<PRE>
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">  struct V {
    virtual void f();
  };

  struct A : virtual V { };

  struct B : virtual V {
    B(V*, A*);
  };

  struct D : A, B {
    D() : B((A*)this, this) { }
  };

  B::B(V* v, A* a) {
    typeid(*this);       //<SPAN style="font-family:Times;font-style:italic"> </SPAN>type_info<SPAN style="font-family:Times;font-style:italic"> for </SPAN>B
    typeid(*v);          //<SPAN style="font-family:Times;font-style:italic"> well-defined: </SPAN>*v<SPAN style="font-family:Times;font-style:italic"> has type </SPAN>V<SPAN style="font-family:Times;font-style:italic">, a base of </SPAN>B
                         //<SPAN style="font-family:Times;font-style:italic"> yields </SPAN>type_info<SPAN style="font-family:Times;font-style:italic"> for </SPAN>B
    typeid(*a);          //<SPAN style="font-family:Times;font-style:italic"> undefined behavior: type </SPAN>A<SPAN style="font-family:Times;font-style:italic"> not a base of </SPAN>B
    dynamic_cast&lt;B*&gt;(v); //<SPAN style="font-family:Times;font-style:italic"> well-defined: </SPAN>v<SPAN style="font-family:Times;font-style:italic"> of type </SPAN>V*<SPAN style="font-family:Times;font-style:italic">, </SPAN>V<SPAN style="font-family:Times;font-style:italic"> base of </SPAN>B
                         //<SPAN style="font-family:Times;font-style:italic"> results in </SPAN>B*
    dynamic_cast&lt;B*&gt;(a); //<SPAN style="font-family:Times;font-style:italic"> undefined behavior,</SPAN>
                         //<SPAN style="font-family:Times;font-style:italic"> </SPAN>a<SPAN style="font-family:Times;font-style:italic"> has type </SPAN>A*<SPAN style="font-family:Times;font-style:italic">, </SPAN>A<SPAN style="font-family:Times;font-style:italic"> not a base of </SPAN>B</SPAN>
</PRE>

<P><SPAN style="text-decoration:line-through;background-color:#FFA0A0">&#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE>

</OL>



<BR><BR><HR><A NAME="1092"></A><H4>1092.
  
Cycles in overload resolution during instantiation
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2010-07-15<BR>




<P>Moving to always doing overload resolution for determining exception 
specifications and implicit deletion creates some unfortunate cycles:</P>

<PRE>
    template&lt;typename T&gt; struct A {
       T t;
    };

    template &lt;typename T&gt; struct B {
       typename T::U u;
    };

    template &lt;typename T&gt; struct C {
       C(const T&amp;);
    };

    template &lt;typename T&gt; struct D {
       C&lt;B&lt;T&gt; &gt; v;
    };

    struct E {
       typedef A&lt;D&lt;E&gt; &gt; U;
    };

    extern A&lt;D&lt;E&gt; &gt; a;
    A&lt;D&lt;E&gt; &gt; a2(a);
</PRE>

<P>If declaring the copy constructor for
<TT>A&lt;D&lt;E&gt;&gt;</TT> is part of instantiating the
class, then we need to do overload resolution on
<TT>D&lt;E&gt;</TT>, and thus <TT>C&lt;B&lt;E&gt;&gt;</TT>.
We consider <TT>C(const B&lt;E&gt;&amp;)</TT>, and therefore
look to see if there's a conversion from
<TT>C&lt;B&lt;E&gt;&gt;</TT> to <TT>B&lt;E&gt;</TT>, which
instantiates <TT>B&lt;E&gt;</TT>, which fails because it has
a field of type <TT>A&lt;D&lt;E&gt;&gt;</TT> which is
already being instantiated.</P>

<P>Even if we wait until <TT>A&lt;D&lt;E&gt;&gt;</TT> is
considered complete before finalizing the copy constructor
declaration, declaring the copy constructor for
<TT>B&lt;E&gt;</TT> will want to look at the copy
constructor for <TT>A&lt;D&lt;E&gt;&gt;</TT>, so we still
have the cycle.</P>

<P>I think that to avoid this cycle we need to short-circuit
consideration of <TT>C(const T&amp;)</TT> somehow.  But I
don't see how we can do that without breaking</P>

<PRE>
    struct F {
       F(F&amp;);
    };

    struct G;
    struct G2 {
       G2(const G&amp;);
    };

    struct G {
       G(G&amp;&amp;);
       G(const G2&amp;);
    };

    struct H: F, G { };

    extern H h;
    H h2(h);
</PRE>

<P>Here, since <TT>G</TT>'s move constructor suppresses the
implicit copy constructor, the defaulted <TT>H</TT> copy
constructor calls <TT>G(const G2&amp;)</TT> instead.  If the
move constructor did not suppress the implicit copy
constructor, I believe the implicit copy constructor would
always be viable, and therefore a better match than a
constructor taking a reference to another type.</P>

<P>So perhaps the answer is to reconsider that suppression
and then disqualify any constructor taking (a reference to)
a type other than the constructor's class from consideration
when looking up a subobject constructor in an implicitly
defined constructor.  (Or assignment operator,
presumably.)</P>

<P>Another possibility would be that when we're looking for
a conversion from <TT>C&lt;B&lt;E&gt;&gt;</TT> to
<TT>B&lt;E&gt;</TT> we could somehow avoid considering, or
even declaring, the <TT>B&lt;E&gt;</TT> copy constructor.
But that seems a bit dodgy.</P>

<P><B>Additional note (October, 2010):</B></P>

<P>An explicitly declared move constructor/op= should not suppress the
implicitly declared copy constructor/op=; it should cause it to be
deleted instead.  This should prevent a member function taking a
(reference to) an un-reference-related type from being chosen by
overload resolution in a defaulted member function.</P>

<P>And we should clarify that member functions taking
un-reference-related types are not even considered during overload
resolution in a defaulted member function, to avoid requiring their
parameter types to be complete.
</P>

<BR><BR><HR><A NAME="1499"></A><H4>1499.
  
Missing case for deleted move assignment operator
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2012-04-27<BR>


<P>Bullet 4 of 12.8 [class.copy] paragraph 23 says that a
defaulted copy/move assignment operator is defined as deleted if the class
has</P>

<BLOCKQUOTE>

a non-static data member of class type <TT>M</TT> (or array thereof) that
cannot be copied/moved because overload resolution (13.3 [over.match]), as applied to <TT>M</TT>'s corresponding assignment operator,
results in an ambiguity or a function that is deleted or inaccessible
from the defaulted assignment operator

</BLOCKQUOTE>

<P>The intent of this is that if overload resolution fails to find a
corresponding copy/move assignment operator that can validly be called
to copy/move a member, the class's assignment operator will be defined
as deleted.  However, this wording does not cover an example like the
following:</P>

<PRE>
  struct A {
    A();
  };

  struct B {
    B();
    const A a;
  };

  typedef B&amp; (B::*pmf)(B&amp;&amp;);

  pmf p =&amp;B::operator=; 
</PRE>

<P>Here, the problem is simply that overload resolution failed to find
a callable function, which is not one of the cases listed in the current
wording.  A similar problem exists for base classes in the fifth bullet.</P>

<P><B>Additional note (January, 2013):</B></P>

<P>A similar omission exists in paragraph 11 for copy constructors.</P>

<BR><BR><HR><A NAME="1548"></A><H4>1548.
  
Copy/move construction and conversion functions
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2012-09-02<BR>




<P>The current wording of 12.8 [class.copy] paragraph 31
refers only to constructors and destructors:</P>

<BLOCKQUOTE>

When certain criteria are met, an implementation is allowed to omit
the copy/move construction of a class object, even if the constructor
selected for the copy/move operation and/or the destructor for the
object have side effects.

</BLOCKQUOTE>

<P>However, in some cases (e.g., <TT>auto_ptr</TT>) a conversion function
is also involved in the copying, and it could presumably also have visible
side effects that would be eliminated by copy elision.  (Some additional
contexts that may also require changes in this regard are mentioned in the
resolution of <A HREF="
     cwg_defects.html#535">issue 535</A>.)</P>

<P><B>Additional note (September, 2012):</B></P>

<P>The default arguments of an elided constructor can also have side
effects and should be mentioned, as well; however, the elision should
not change the odr-use status of functions and variables appearing in
those default arguments. </P>

<BR><BR><HR><A NAME="1590"></A><H4>1590.
  
Bypassing non-copy/move constructor copying
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-11-26<BR>




<P>Copy initialization in some cases uses constructors that are not
copy/move constructors (e.g., a specialization of a constructor
template might be selected by overload resolution, or in
copy-list-initialization, any constructor could be selected).  Some
ABIs require that an object of certain class types be passed in a
register (effectively using the trivial copy/move constructor), even
if the class has a non-trivial constructor that would be selected to
do the copy.  The Standard should be changed to permit this usage.</P>

<P><B>Proposed resolution (April, 2013):</B></P>

<P>Add the following as a new paragraph following 12.8 [class.copy]
paragraph 1:</P>

<BLOCKQUOTE>

<SPAN style="font-weight:bold;background-color:#A0FFA0">When an object of class type <TT>X</TT> is passed to or returned from
a function, if <TT>X</TT> has a trivial, accessible copy or move
constructor that is not deleted, and <TT>X</TT> has no non-trivial copy
constructors, move constructors, or destructors, implementations are
permitted to perform an additional copy or move of the object using the
trivial constructor (even if it would not be selected by overload
resolution to perform a copy or move of the object).  [<I>Note:</I> This
latitude is granted to allow objects of class type to be passed to or
returned from functions in registers. &#8212;<I>end note</I>]</SPAN>

</BLOCKQUOTE>

<P>See also <A HREF="
     cwg_active.html#1928">issue 1928</A>.</P>

<P><B>Additional note, May, 2014:</B></P>

<P>Questions have been raised  regarding this resolution.  In
particular, the interaction of the &#8220;extra copy&#8221; with copy
elision, lifetime, and access checking context are not specified.  In
addition, some concern has also been expressed regarding the requirement
that the trivial copy/move constructor be accessible.  The issue is being
returned to "review" status for discussion of these points.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG felt that the requirements for accessibility should be
removed, in line with the idea making all access <TT>opublic</TT>
in a program should not change its semantics.  Similarly, the
prohibition of non-trivial functions was not desirable.  The
approach should be to recognize the extra copy as a temporary
object and deal explicitly with its lifetime.</P>

<BR><BR><HR><A NAME="1594"></A><H4>1594.
  
Lazy declaration of special members vs overload errors
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-12-06<BR>




<P>The implicit declaration of a special member function sometimes
requires overload resolution, in order to select a special member to
use for base classes and non-static data members. This can be required
to determine whether the member is or would be deleted, and whether
the member is trivial, for instance. The standard appears to require
such overload resolution be performed at the end of the definition of
the class, but in practice, implementations perform it lazily. This
optimization appears to be non-conforming, in the case where overload
resolution would hit an error.  In order to enable this optimization,
such errors should be &#8220;no diagnostic required.&#8221;</P>

<P><B>Additional note (March, 2013):</B></P>

<P>See also <A HREF="
     cwg_active.html#1360">issue 1360</A>.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>The problem with this approach is that hard errors (not in the
immediate context) can occur, affecting portability.  There are some
cases, such as a virtual assignment operator in the base class, where
lazy evaluation cannot be done, so it cannot be mandated.</P>

<BR><BR><HR><A NAME="1734"></A><H4>1734.
  
Nontrivial deleted copy functions
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-09<BR>




<P>The intent was for PODs in C++11 to be a superset of C++03 PODs.
Consequently, in the following example, <TT>C</TT> should be a POD
but isn't:</P>

<PRE>
  struct A {
    const int m;
    A&amp; operator=(A const&amp;) = default; //<SPAN style="font-family:Times;font-style:italic"> deleted and trivial, so </SPAN>A<SPAN style="font-family:Times;font-style:italic"> is a</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> POD, as it would be in 2003</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> without this explicit </SPAN>op=<SPAN style="font-family:Times;font-style:italic"> decl</SPAN>
  };
  static_assert(__is_trivially_copyable(A), "");

  struct B { 
    int i; 
    B&amp; operator=(B &amp;) &amp; = default;      //<SPAN style="font-family:Times;font-style:italic"> non-trivial</SPAN>
    B&amp; operator=(B const&amp;) &amp; = default; //<SPAN style="font-family:Times;font-style:italic"> trivial</SPAN>
  };

  struct C {
    const B m;
    C&amp; operator=(C const&amp; r) = default; //<SPAN style="font-family:Times;font-style:italic"> deleted (apparently), but non-trivial (apparently)</SPAN>
    /*<SPAN style="font-family:Times;font-style:italic"> Notionally:</SPAN>
      C&amp; operator=(C const&amp; r) {
        (*this).m.operator=(r.m);
        return *this;
      }
    */
  };
  static_assert(!__is_trivially_copyable(C), "");  
</PRE>

<P>This is because of the following text from 12.8 [class.copy]
paragraph 25:</P>

<BLOCKQUOTE>

for each non-static data member of <TT>X</TT> that is of class type (or
array thereof), the assignment operator selected to copy/move that member
is trivial;

</BLOCKQUOTE>

<P>In this case, overload resolution fails, so no assignment operator
is selected, so <TT>C::operator=(const C&amp;)</TT> is non-trivial.</P>

<P>(See also <A HREF="
     cwg_active.html#1928">issue 1928</A>.)</P>

<P><B>Additional note, November, 2014:</B></P>

<P>See paper N4148.</P>

<BR><BR><HR><A NAME="1645"></A><H4>1645.
  
Identical inheriting constructors via default arguments
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-18<BR>




<P>For an example like</P>

<PRE>
  struct A {
    constexpr A(int, float = 0);
    explicit A(int, int = 0);
    A(int, int, int = 0) = delete;
  };

  struct B : A {
    using A::A;
  };
</PRE>

<P>it is not clear from 12.9 [class.inhctor] what
should happen: is <TT>B::B(int)</TT> <TT>constexpr</TT>
and/or <TT>explicit</TT>?  Is <TT>B::B(int,
int)</TT> <TT>explicit</TT> and/or deleted?  Although the
rationale given in the note in paragraph 7,</P>

<BLOCKQUOTE>

If two <I>using-declaration</I>s declare inheriting
constructors with the same signatures, the program is
ill-formed (9.2 [class.mem],
13.1 [over.load]), because an implicitly-declared
constructor introduced by the first <I>using-declaration</I>
is not a user-declared constructor and thus does not
preclude another declaration of a constructor with the same
signature by a subsequent <I>using-declaration</I>.

</BLOCKQUOTE>

<P>might be thought to apply, paragraph 1 talks about
a <I>set</I> of candidate constructors based on their
parameter types, so presumably such a set would contain only
a single declaration of <TT>A::A(int)</TT> and one
for <TT>A::A(int, int)</TT>.  The constructor
characteristics of that declaration, however, are not
specified.</P>

<P>One possibility might be to declare such a constructor, resulting
from the transformation of more than one base class constrctor, to
be deleted, so there would be an error only if it were used.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>CWG agreed with the direction of defining such constructors as
deleted.</P>

<P><B>Additional note, June, 2014:</B></P>

<P>See <A HREF="
     cwg_active.html#1941">issue 1941</A> for an alternative
approach to this problem.</P>

<BR><BR><HR><A NAME="1715"></A><H4>1715.
  
Access and inherited constructor templates
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-16<BR>




<P>Consider the following example:</P>

<PRE>
  template&lt;class T&gt; struct S {
  private:
    typedef int X;
    friend struct B;
  };

  struct B {
    template&lt;class T&gt; B(T, typename T::X);
  };

  struct D: B {
    using B::B;
  };

  S&lt;int&gt; s;
  B b(s, 2); //<SPAN style="font-family:Times;font-style:italic"> Okay, thanks to friendship.</SPAN>
  D d(s, 2); //<SPAN style="font-family:Times;font-style:italic"> Error: friendship is not inherited.</SPAN>
</PRE>

<P>My understanding is that the construction of <TT>d</TT> fails
because <TT>typename T::X</TT> expands to <TT>S&lt;int&gt;::X</TT> in this
case, and that is not accessible from <TT>D</TT>.</P>

<P>However, I'm not sure that makes sense from a usability perspective.
The user of <TT>D</TT> just wanted to be able to wrap class <TT>B</TT>, and
the fact that friendship was granted to <TT>B</TT> to enable its
constructor parameter seems like just an implementation detail
that <TT>D</TT> shouldn't have to cope with.</P>

<P>Would it perhaps be better to suspend access checking during the
instantiation of inheriting member function template declarations (not
definitions), since real access problems (e.g., the selection of a private
constructor) would presumably be revealed when doing the full
instantiation?</P>

<P><B>Proposed resolution (February, 2014):</B></P>

<P>Change 12.9 [class.inhctor] paragraph 4 as follows:</P>

<BLOCKQUOTE>

<P>A constructor so declared has the same access as the corresponding
constructor in <TT>X</TT>. It is deleted if the corresponding constructor
in <TT>X</TT> is deleted (<SPAN style="text-decoration:line-through;background-color:#FFA0A0">8.4 [dcl.fct.def]</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">8.4.3 [dcl.fct.def.delete]</SPAN>). <SPAN style="font-weight:bold;background-color:#A0FFA0">While performing template
argument substitution (14.8.2 [temp.deduct]) for constructor
templates so declared, name lookup, overload resolution, and access
checking are performed in the context of the corresponding constructor
template of <TT>X</TT>. [<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">   struct B {
     template&lt;class T&gt; B(T, typename T::Q);
   };

   class S {
     using Q = int;
     template&lt;class T&gt;
     friend B::B(T, typename T::Q);
   };

   struct D : B {
     using B::B;
   };

   B b(S(), 1); //<SPAN style="font-family:Times;font-style:italic"> OK: </SPAN>B::B<SPAN style="font-family:Times;font-style:italic"> is a friend of </SPAN>S
   D d(S(), 2); //<SPAN style="font-family:Times;font-style:italic"> OK: access control is in the context of </SPAN>B::B</SPAN>
</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example</I>]</SPAN> An inheriting constructor shall not
be explicitly instantiated (14.7.2 [temp.explicit]) or explicitly
specialized (14.7.3 [temp.expl.spec]).</P>

</BLOCKQUOTE>

<P><B>Additional note (June, 2014):</B></P>

<P>This issue is being returned to "review" status in light of a
suggestion for an alternative approach to the problem; see
<A HREF="
     cwg_active.html#1941">issue 1941</A>.</P>

<BR><BR><HR><A NAME="1736"></A><H4>1736.
  
Inheriting constructor templates in a local class
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-13<BR>


<P>A local class cannot, according to 14.5.2 [temp.mem]
paragraph 2, have member templates.  Presumably, then, an example like
the following is ill-formed:</P>

<PRE>
  struct S {
    template&lt;class T&gt; S(T) {
      struct L: S {
        using S::S;
      };
    }
  }; 
</PRE>

<P>It is accepted by current implementations, however.  Does something need
to be said about this case in 12.9 [class.inhctor], either to
explicitly allow or forbid it, or is the restriction in
14.5.2 [temp.mem] sufficient?</P>

<BR><BR><HR><A NAME="1941"></A><H4>1941.
  
SFINAE and inherited constructor default arguments
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-12<BR>


<P>Default arguments are a common mechanism for applying SFINAE to
constructors.  However, default arguments are not carried over
when base class constructors are inherited; instead, an overload
set of constructors with various numbers of arguments is created
in the derived class.  This seems problematic.</P>

<P>One possibility would be to change the mechanism for how
constructors are inherited; a <I>using-declaration</I> might
actually introduce the base class constructors into the derived
class, as other <I>using-declaration</I>s do, and if a base class
constructor were selected, the remaining derived class members
would be default-initialized.</P>

<P>This approach would also address issues <A HREF="
     cwg_active.html#1645">1645</A>, as duplicated constructors would simply fail during
overload resolution, and <A HREF="
     cwg_active.html#1715">1715</A>, since
there would be no synthesized constructors for which access
checking would be needed.</P>

<P>The effect of such an approach on ABIs, including mangling, would
need to be considered.</P>

<P>See also <A HREF="
     cwg_active.html#1959">issue 1959</A>.</P>

<BR><BR><HR><A NAME="1959"></A><H4>1959.
  
Inadvertently inherited copy constructor
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-30<BR>


<P>Consider the following example:</P>

<PRE>
  struct a {
    a() = default;
    a( a const &amp; ) { std::cout &lt;&lt; "copy\n"; }
    template&lt; typename t &gt;
    a( t ) { std::cout &lt;&lt; "convert\n"; }
  };

  struct b : a {
    using a::a;
  };

  a x;
  b y = x;
</PRE>

<P>The copy constructor is invoked by the inherited constructor
template, making it effectively inherited, contrary to the intent of
12.9 [class.inhctor] paragraph 3.  <TT>std::function</TT> is
affected by this issue.</P>

<P>A kernel of a resolution might be to inherit the copy and
move constructors as deleted. Then they will be more
specialized than any template, and the user won't get
conversion-from-base behavior unless they explicitly declare
it. However, reference binding in overload resolution is a
potential gap. Something like <TT>b::b( a &amp; ) = delete</TT> with
a non-const parameter would not add safety if it's not
chosen.</P>

<P>See also <A HREF="
     cwg_active.html#1941">issue 1941</A>.</P>

<BR><BR><HR><A NAME="1252"></A><H4>1252.
  
Overloading member function templates based on dependent return type
</H4><B>Section: </B>13.1&#160; [over.load]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-06<BR>




<P>The Standard does not allow overloading of member functions that
differ only in their return type (cf <TT>enable_if</TT>).</P>

<BR><BR><HR><A NAME="1898"></A><H4>1898.
  
Use of &#8220;equivalent&#8221; in overload resolution
</H4><B>Section: </B>13.2&#160; [over.dcl]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-21<BR>




<P>The normative text of 13.2 [over.dcl] relies on the
term &#8220;equivalent,&#8221; for which it refers to
13.1 [over.load], but the term appears there only in
non-normative text.  The resolution of this issue should be coordinated
with that of <A HREF="
     cwg_active.html#1668">issue 1668</A>.</P>

<BR><BR><HR><A NAME="1278"></A><H4>1278.
  
Incorrect treatment of contrived object
</H4><B>Section: </B>13.3.1.1.1&#160; [over.call.func]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-27<BR>




<P>Footnote 127 of 13.3.1.1.1 [over.call.func] paragraph 3 reads,</P>

<BLOCKQUOTE>

An implied object argument must be contrived to correspond to the
implicit object parameter attributed to member functions during
overload resolution.  It is not used in the call to the selected
function.  Since the member functions all have the same implicit
object parameter, the contrived object will not be the cause to select
or reject a function.

</BLOCKQUOTE>

<P>It is not true that &#8220;the member functions all have the same
implicit object parameter.&#8221;  This statement does not take into
account member functions brought into the class by <I>using-declaration</I>s
or <I>cv-qualifier</I>s and <I>ref-qualifier</I>s on the non-static
member functions:</P>

<PRE>
    struct B
    {
      char f();         // B &amp;
    };

    struct D : B
    {
      using B::f;
      long f();         // D &amp;

      char g() const;   // D const &amp;
      long g();         // D &amp;

      char h() &amp;;       // D &amp;
      long h() &amp;&amp;;      // D &amp;&amp;
    };

    int main()
    {
      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>D::f()<SPAN style="font-family:Times;font-style:italic"> has better match than </SPAN>B::f()<SPAN style="font-family:Times;font-style:italic"></SPAN>
      decltype(D().f()) *p1 = (long *)0;

      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>D::g()<SPAN style="font-family:Times;font-style:italic"> has better match than </SPAN>D::g() const<SPAN style="font-family:Times;font-style:italic"></SPAN>
      decltype(D().g()) *p2 = (long *)0;

      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>D::h() &amp;<SPAN style="font-family:Times;font-style:italic"> is not viable function</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>D::h() &amp;&amp;<SPAN style="font-family:Times;font-style:italic"> is viable function</SPAN>
      decltype(D().h()) *p3 = (long *)0;
    }
</PRE>

<P>The value category of a contrived object expression is not
specified by the rules and, probably, cannot be properly specified in
presence of <I>ref-qualifier</I>s, so the statement &#8220;the
contrived object will not be the cause to select or reject a
function&#8221; should be normative rather than informative:</P>

<PRE>
    struct X
    {
      static void f(double) {}
      void f(int) &amp; {}
      void f(int) &amp;&amp; {}
    };

    int main()
    {
      X::f(0); //<SPAN style="font-family:Times;font-style:italic"> ???</SPAN>
    }
</PRE>

<BR><BR><HR><A NAME="2007"></A><H4>2007.
  
Argument-dependent lookup for <TT>operator=</TT>
</H4><B>Section: </B>13.3.1.2&#160; [over.match.oper]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-23<BR>




<P>Consider an example like:</P>

<PRE>
  template&lt;typename T&gt; struct A { typename T::error e; };
  template&lt;typename T&gt; struct B { };
  B&lt;A&lt;void&gt;&gt; b1, &amp;b2 = (b1 = b1);
</PRE>

<P>If the assignment operator performs argument-dependent lookup,
<TT>A&lt;void&gt;</TT> will be an associated class and will be
instantiated, producing an error.  Similar questions apply to
the other member-only overloaded operators, <TT>operator-&gt;</TT>
and <TT>operator[]</TT>.  Bullet 3.2 of 13.3.1.2 [over.match.oper]
should be changed not to perform unqualified lookup for these
operators.</P>

<BR><BR><HR><A NAME="2028"></A><H4>2028.
  
Converting constructors in rvalue reference initialization
</H4><B>Section: </B>13.3.1.6&#160; [over.match.ref]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mitsuru Kariya
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-25<BR>


<P>Consider the following example:</P>

<PRE>
  struct T {
    T() {}
    T(struct S&amp;) {}
  };

  struct S {
    operator T() { return T(); }
  };

  int main()
  {
    S s;
    T&amp;&amp; t(s);  //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
  }
</PRE>

<P>Because there are two possible conversions from <TT>S</TT> to
<TT>T</TT>, one by conversion function and the other by converting
constructor, one might expect that the initialization at #1 would
be ambiguous.  However, 13.3.1.6 [over.match.ref] (used in the
relevant bullet of 8.5.3 [dcl.init.ref], paragraph 5.2.1.2)
only deals with conversion functions and ignores converting
constructors.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG agreed that 8.5.3 [dcl.init.ref] should be changed
to consider converting constructors in this case.</P>

<BR><BR><HR><A NAME="455"></A><H4>455.
  
Partial ordering and non-deduced arguments
</H4><B>Section: </B>13.3.3&#160; [over.match.best]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Rani Sharoni
 &#160;&#160;&#160;

 <B>Date: </B>19 Jan 2004<BR>


<P>
It's not clear how overloading and partial ordering handle non-deduced pairs
of corresponding arguments. For example:</P>
<PRE>
template&lt;typename T&gt;
struct A { typedef char* type; };

template&lt;typename T&gt; char* f1(T, typename A&lt;T&gt;::type);  // #1
template&lt;typename T&gt; long* f1(T*, typename A&lt;T&gt;::type*); // #2

long* p1 = f1(p1, 0); // #3
</PRE>
<P>I thought that #3 is ambiguous but different compilers disagree on that.
Comeau C/C++ 4.3.3 (EDG 3.0.3) accepted the code, GCC 3.2 and BCC 5.5
selected #1 while VC7.1+ yields ambiguity.</P>

<P>I intuitively thought that the second pair should prevent overloading from
triggering partial ordering since both arguments are non-deduced and has
different types - (char*, char**). Just like in the following:</P>
<PRE>
template&lt;typename T&gt; char* f2(T, char*);   // #3
template&lt;typename T&gt; long* f2(T*, char**); // #4

long* p2 = f2(p2, 0); // #5
</PRE>
<P>In this case all the compilers I checked found #5 to be ambiguous.
The standard and DR <A HREF="
     cwg_defects.html#214">214</A> is not clear
about how partial ordering handle such
cases.</P>

<P>I think that overloading should not trigger partial ordering (in step
13.3.3 [over.match.best]/1/5) if some candidates have
non-deduced pairs with different
(specialized) types. In this stage the arguments are already adjusted so no
need to mention it (i.e. array to pointer). In case that one of the
arguments is non-deuced then partial ordering should only consider the type
from the specialization:</P>
<PRE>
template&lt;typename T&gt; struct B { typedef T type; };

template&lt;typename T&gt; char* f3(T, T);                   // #7
template&lt;typename T&gt; long* f3(T, typename B&lt;T&gt;::type); // #8

char* p3 = f3(p3, p3); // #9
</PRE>
<P>According to my reasoning #9 should yield ambiguity since second pair is (T,
long*). The second type (i.e. long*) was taken from the specialization
candidate of #8.
EDG and GCC accepted the code. VC and BCC found an ambiguity.</P>

<P><U>John Spicer:</U>
There may (or may not) be an issue concerning whether nondeduced
contexts are handled properly in the partial ordering rules.  In
general, I think nondeduced contexts work, but we should walk through
some examples to make sure we think they work properly.</P>

<P>Rani's description of the problem suggests that he believes that
partial ordering is done on the specialized types.  This is not
correct.  Partial ordering is done on the templates themselves,
independent of type information from the specialization.</P>

<P><B>Notes from October 2004 meeting:</B></P>

<P>John Spicer will investigate further to see if any action is
required.</P>

<P>(See also <A HREF="
     cwg_closed.html#885">issue 885</A>.)</P>



<BR><BR><HR><A NAME="1536"></A><H4>1536.
  
Overload resolution with temporary from initializer list
</H4><B>Section: </B>13.3.3.1.5&#160; [over.ics.list]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2012-08-14<BR>


<P>In determining the implicit conversion sequence for an initializer list
argument passed to a reference parameter, the intent is that a temporary
of the appropriate type will be created and bound to the reference, as
reflected in 13.3.3.1.5 [over.ics.list] paragraph 5:</P>

<BLOCKQUOTE>

Otherwise, if the parameter is a reference, see 13.3.3.1.4 [over.ics.ref].  [<I>Note:</I> The rules in this section will
apply for initializing the underlying temporary for the reference.
&#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>However, 13.3.3.1.4 [over.ics.ref] deals only with expression
arguments, not initializer lists:</P>

<BLOCKQUOTE>

<P>When a parameter of reference type binds directly (8.5.3 [dcl.init.ref]) to an argument expression, the implicit conversion
sequence is the identity conversion, unless the argument expression
has a type that is a derived class of the parameter type, in which
case the implicit conversion sequence is a derived-to-base Conversion
(13.3.3.1 [over.best.ics])... If the parameter binds directly to
the result of applying a conversion function to the argument
expression, the implicit conversion sequence is a user-defined
conversion sequence (13.3.3.1.2 [over.ics.user]), with the second
standard conversion sequence either an identity conversion or, if the
conversion function returns an entity of a type that is a derived
class of the parameter type, a derived-to-base Conversion.
</P>

<P>When a parameter of reference type is not bound directly to an
argument expression, the conversion sequence is the one required to
convert the argument expression to the underlying type of the
reference according to 13.3.3.1 [over.best.ics].  Conceptually,
this conversion sequence corresponds to copy-initializing a temporary
of the underlying type with the argument expression.  Any difference
in top-level cv-qualification is subsumed by the initialization itself
and does not constitute a conversion.
</P>

</BLOCKQUOTE>

<P>(Note in particular that the reference binding refers to
8.5.3 [dcl.init.ref], which also does not handle initializer
lists, and not to 8.5.4 [dcl.init.list].)</P>

<P>Either 13.3.3.1.4 [over.ics.ref] needs to be revised to
handle binding references to initializer list arguments or
13.3.3.1.5 [over.ics.list] paragraph 5 needs to be clearer on how
the expression specification is intended to be applied to
initializer lists.</P>



<BR><BR><HR><A NAME="1789"></A><H4>1789.
  
Array reference vs array decay in overload resolution
</H4><B>Section: </B>13.3.3.2&#160; [over.ics.rank]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Faisal Vali
 &#160;&#160;&#160;

 <B>Date: </B>2013-10-01<BR>




<P>The current rules make an example like</P>

<PRE>
  template&lt;class T, size_t N&gt; void foo(T (&amp;)[N]);
  template&lt;class T&gt; void foo(T *t);

  int arr[3]{1, 2, 3};
  foo(arr);
</PRE>

<P>ambiguous, even though the first is an identity match and the
second requires an lvalue transformation.  Is this desirable?</P>

<BR><BR><HR><A NAME="1989"></A><H4>1989.
  
Insufficient restrictions on parameters of postfix operators
</H4><B>Section: </B>13.5&#160; [over.oper]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-30<BR>


<P>According to 13.5.7 [over.inc] paragraph 1,</P>

<BLOCKQUOTE>

The user-defined function called <TT>operator++</TT> implements the
prefix and postfix <TT>++</TT> operator. If this function is a
non-static member function with no parameters, or a
non-member function with one parameter, it defines the
prefix increment operator <TT>++</TT> for objects of that type. If
the function is a non-static member function with one
parameter (which shall be of type <TT>int</TT>) or a non-member
function with two parameters (the second of which shall be
of type <TT>int</TT>), it defines the postfix increment operator <TT>++</TT>
for objects of that type.

</BLOCKQUOTE>

<P>According to 13.5 [over.oper] paragraph 8,</P>

<BLOCKQUOTE>

Operator functions cannot have more or fewer parameters than
the number required for the corresponding operator, as
described in the rest of this subclause.

</BLOCKQUOTE>

<P>This does not rule out an <TT>operator++</TT> with more than two
parameters, however, since there is no corresponding operator.</P>

<P>One possibility might be to add a sentence like,</P>

<BLOCKQUOTE>

A function named <TT>operator++</TT> shall declare either a prefix
or postfix increment operator.

</BLOCKQUOTE>

<BR><BR><HR><A NAME="205"></A><H4>205.
  
Templates and static data members
</H4><B>Section: </B>14&#160; [temp]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>11 Feb 2000<BR>



<P>Static data members of template classes and of nested classes of
template classes are not themselves templates but receive much the
same treatment as template.  For instance,
14 [temp]
 paragraph 1 says that templates
are only "classes or functions" but implies that "a static data member
of a class template or of a class nested within a class template" is
defined using the <I>template-declaration</I> syntax.</P>

<P>There are many places in the clause, however, where static data
members of one sort or another are overlooked.  For instance,
14 [temp]
 paragraph 6 allows static data
members of class templates to be declared with the <TT>export</TT>
keyword.  I would expect that static data members of (non-template)
classes nested within class templates could also be exported, but they
are not mentioned here.</P>

<P>Paragraph 8, however, overlooks static data members altogether and
deals only with "templates" in defining the effect of the
<TT>export</TT> keyword; there is no description of the semantics of
defining a static data member of a template to be exported.</P>

<P>These are just two instances of a systematic problem.  The entire
clause needs to be examined to determine which statements about
"templates" apply to static data members, and which statements about
"static data members of class templates" also apply to static data
members of non-template classes nested within class templates.</P>

<P>(The question also applies to member functions of template classes;
see <A HREF="
     cwg_defects.html#217">issue 217</A>, where the phrase
"non-template function" in 8.3.6 [dcl.fct.default] paragraph 4
is apparently intended <I>not</I> to include non-template member
functions of template classes.  See also <A HREF="
     cwg_defects.html#108">issue 108</A>, which would benefit from understanding nested classes of
class templates as templates.  Also, see <A HREF="
     cwg_defects.html#249">issue 249</A>, in which the usage of the phrase "member function
template" is questioned.)</P>

<P><B>Notes from the 4/02 meeting:</B></P>

<P>Daveed Vandevoorde will propose appropriate terminology.</P>

<BR><BR><HR><A NAME="1444"></A><H4>1444.
  
Type adjustments of non-type template parameters
</H4><B>Section: </B>14.1&#160; [temp.param]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2012-01-15<BR>




<P>The type adjustment of template non-type parameters described in
14.1 [temp.param] paragraph 8 appears to be underspecified.  For
example, implementations vary in their treatment of</P>

<PRE>
  template&lt;typename T, T[T::size]&gt; struct A {};
  int dummy;
  A&lt;int, &amp;dummy&gt; a;
</PRE>

<P>and</P>

<PRE>
  template&lt;typename T, T[1]&gt; struct A;
  template&lt;typename T, T*&gt; struct A {};
  int dummy;
  A&lt;int, &amp;dummy&gt; a;
</PRE>

<P>See also issues <A HREF="
     cwg_active.html#1322">1322</A> and
<A HREF="
     cwg_active.html#1668">1668</A>.</P>

<BR><BR><HR><A NAME="1635"></A><H4>1635.
  
How similar are template default arguments to function default arguments?
</H4><B>Section: </B>14.1&#160; [temp.param]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-06<BR>




<P>Default function arguments are instantiated only when needed.  Is
the same true of default template arguments?  For example, is the
following well-formed?</P>

<PRE>
  #include &lt;type_traits&gt;

  template&lt;class T&gt;
  struct X {
    template&lt;class U = typename T::type&gt;
    static void foo(int){}
    static void foo(...){}
  };

  int main(){
    X&lt;std::enable_if&lt;false&gt;&gt;::foo(0);
  }
</PRE>

<P>Also, is the effect on lookup the same?  E.g.,</P>

<PRE>
  struct S {
    template&lt;typename T = U&gt; void f();
    struct U {};
  };
</PRE>

<BR><BR><HR><A NAME="1478"></A><H4>1478.
  
<TT>template</TT> keyword for dependent template template arguments
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2012-03-10<BR>




<P>According to 14.2 [temp.names] paragraph 4,</P>

<BLOCKQUOTE>

When the name of a member template specialization appears after <TT>.</TT> or
<TT>-&gt;</TT> in a <I>postfix-expression</I> or after a
<I>nested-name-specifier</I> in a <I>qualified-id</I>, and the object
expression of the <I>postfix-expression</I> is type-dependent or the
<I>nested-name-specifier</I> in the <I>qualified-id</I> refers to a
dependent type, but the name is not a member of the current
instantiation (14.6.2.1 [temp.dep.type]), the member template
name must be prefixed by the keyword <TT>template</TT>.

</BLOCKQUOTE>

<P>In other words, the <TT>template</TT> keyword is only required when
forming a <I>template-id</I>.  However, current compilers reject an
example like:</P>

<PRE>
  template&lt;typename T, template&lt;typename&gt; class U = T::X&gt; struct A;
</PRE>

<P>and require the <TT>template</TT> keyword before <TT>X</TT>.
Should the rule be amended to require the <TT>template</TT> keyword in
cases like this?</P>

<BR><BR><HR><A NAME="1729"></A><H4>1729.
  
Matching declarations and definitions of variable templates
</H4><B>Section: </B>14.5&#160; [temp.decls]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Larisse Voufo
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-05<BR>




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

<PRE>
  template&lt;typename T&gt; auto var0 = T();  //<SPAN style="font-family:Times;font-style:italic"> #1a.</SPAN>
  template&lt;typename T&gt; extern T var0;    //<SPAN style="font-family:Times;font-style:italic"> #1b.</SPAN>

  template&lt;typename T&gt; T var1;           //<SPAN style="font-family:Times;font-style:italic"> #2a.</SPAN>
  template&lt;typename T&gt; extern auto var1; //<SPAN style="font-family:Times;font-style:italic"> #2b.</SPAN>
  template&lt;typename T&gt; extern T var1;    //<SPAN style="font-family:Times;font-style:italic"> #2c.</SPAN>
  template&lt;typename T&gt; T var1;           //<SPAN style="font-family:Times;font-style:italic"> #2d.</SPAN>
</PRE>

<P>Questions:</P>

<OL><LI><P>When is a variable template declaration a definition and
when a non-defining declaration?</P></LI>

<LI><P>What declarations are valid?</P></LI>

<LI><P>Should <TT>auto</TT> declarations be allowed?</P></LI>

<LI><P>To what extent, if any, do these involve type matching?</P></LI>

<LI><P>How are types matched, especially in the presence of
<TT>auto</TT>?</P></LI>

</OL>

<BR><BR><HR><A NAME="1730"></A><H4>1730.
  
Can a variable template have an unnamed type?
</H4><B>Section: </B>14.5&#160; [temp.decls]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Larisse Voufo
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-05<BR>




<P>Is it permitted for a variable template to have an unnamed
type?</P>

<BR><BR><HR><A NAME="1432"></A><H4>1432.
  
Newly-ambiguous variadic template expansions
</H4><B>Section: </B>14.5.3&#160; [temp.variadic]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2011-12-17<BR>


<P>With the new core rules in regard to variadic pack expansions
the library specification of the traits template
<TT>common_type</TT> is now broken, the reason is that it is
defined as a series of specializations of the primary template</P>

<PRE>
    template &lt;class ...T&gt;
    struct common_type;
</PRE>

<P>The broken one is this pair:</P>

<PRE>
  template &lt;class T, class U&gt;
  struct common_type&lt;T, U&gt; {
   typedef decltype(true ? declval&lt;T&gt;() : declval&lt;U&gt;()) type;
  };

  template &lt;class T, class U, class... V&gt;
  struct common_type&lt;T, U, V...&gt; {
   typedef typename common_type&lt;typename common_type&lt;T, U&gt;::type, V...&gt;::type type;
  };
</PRE>

<P>With the new rules both specializations would now be ambiguous
for an instantiation like <TT>common_type&lt;X, Y&gt;</TT>.</P>

<P>(See also <A HREF="
     cwg_active.html#1395">issue 1395</A>.)</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>It is possible that 14.5.5.2 [temp.class.order] may resolve this
problem.</P>

<BR><BR><HR><A NAME="1545"></A><H4>1545.
  
<TT>friend</TT> function templates defined in class templates
</H4><B>Section: </B>14.5.4&#160; [temp.friend]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-08-25<BR>




<P>The status of an example like the following is not clear:</P>

<PRE>
   template&lt;class&gt; struct x {
     template&lt;class T&gt;
     friend bool operator==(x&lt;T&gt;, x&lt;T&gt;) { return false; }
  };

  int main() {
    x&lt;int&gt; x1;
    x&lt;double&gt; x2;
    x1 == x1;
    x2 == x2;
  }
</PRE>

<P>Such a <TT>friend</TT> definition is permitted by
14.5.4 [temp.friend] paragraph 2:</P>

<BLOCKQUOTE>

A friend function template may be defined within a class or class
template...

</BLOCKQUOTE>

<P>Paragraph 4 appears to be related, but deals only with friend functions,
not friend function templates:</P>

<BLOCKQUOTE>

When a function is defined in a friend function declaration in a class
template, the function is instantiated when the function is
odr-used. The same restrictions on multiple declarations and
definitions that apply to non-template function declarations and
definitions also apply to these implicit definitions.

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1862"></A><H4>1862.
  
Determining &#8220;corresponding members&#8221; for friendship
</H4><B>Section: </B>14.5.4&#160; [temp.friend]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>


<P>During the discussion of <A HREF="
     cwg_defects.html#1804">issue 1804</A>, it was
noted that the process of determining whether a member of an explicit or
partial specialization corresponds to a member of the primary template is
not well specified.  In particular, it should be clarified that the primary
template should not be instantiated during this process; instead, the
template arguments from the specialization should simply be substituted
into the member declaration.</P>

<BR><BR><HR><A NAME="1315"></A><H4>1315.
  
Restrictions on non-type template arguments in partial specializations
</H4><B>Section: </B>14.5.5&#160; [temp.class.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-05-12<BR>




<P>The rationale for the restriction in 14.5.5 [temp.class.spec]
paragraph 8, first bullet is not clear:</P>

<UL><LI><P>A partially specialized non-type argument expression shall
not involve a template parameter of the partial specialization except
when the argument expression is a simple
<I>identifier</I>. [<I>Example:</I></P></LI>

<PRE>
  template &lt;int I, int J&gt; struct A {};
  template &lt;int I&gt; struct A&lt;I+5, I*2&gt; {}; //<SPAN style="font-family:Times;font-style:italic"> error</SPAN>
  template &lt;int I, int J&gt; struct B {};
  template &lt;int I&gt; struct B&lt;I, I&gt; {};     //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
</PRE>

<P>&#8212;<I>end example</I>]</P>

</UL>

<P>In the example, it's clear that <TT>I</TT> is non-deducible, but
this rule prevents plausible uses like:</P>

<PRE>
  template &lt;int I, int J&gt; struct A {};
  template &lt;int I&gt; struct A&lt;I, I*2&gt; {};
</PRE>



<BR><BR><HR><A NAME="1647"></A><H4>1647.
  
Type agreement of non-type template arguments in partial specializations
</H4><B>Section: </B>14.5.5&#160; [temp.class.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-04<BR>


<P>The Standard appears to be silent on whether the types of
non-type template arguments in a partial specialization must be
the same as those of the primary template or whether conversions
are permitted.  For example,</P>

<PRE>
  template&lt;char...&gt; struct char_values {};
  template&lt;int C1, char C3&gt;
  struct char_values&lt;C1, 12, C3&gt; {
    static const unsigned value = 1;
  };
  int check0[char_values&lt;1, 12, 3&gt;::value == 1? 1 : -1]; 
</PRE>

<P>The closest the current wording comes to dealing with this
question is 14.5.5 [temp.class.spec] paragraph 8 bullet 1:</P>

<UL><LI><P>A partially specialized non-type argument expression shall
not involve a template parameter of the partial
specialization except when the argument expression is a
simple <I>identifier</I>.</P></LI>

</UL>

<P>In this example, one might think of the first template argument
in the partial specialization as <TT>(char)C1</TT>, which would
violate the requirement, but that reasoning is tenuous.</P>

<P>It would be reasonable to require the types to match in
cases like this.  If this kind of usage is allowed it could
get messy if the primary template were <TT>int...</TT> and
the partial specialization had a parameter that
was <TT>char</TT> because not all of the possible values
from the primary template could be represented in the
parameter of the partial specialization.  A similar issue
exists if the primary template takes <TT>signed char</TT>
and the partial specialization takes <TT>unsigned
int</TT>.</P>

<P>There is implementation variance in the treatment of this
example.</P>

<BR><BR><HR><A NAME="1711"></A><H4>1711.
  
Missing specification of variable template partial specializations
</H4><B>Section: </B>14.5.5&#160; [temp.class.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-08<BR>




<P>It appears that partial specializations of variable templates are
intended to be supported, as 14.3.3 [temp.arg.template] paragraph 2
says,</P>

<BLOCKQUOTE>

Any partial specializations (14.5.5 [temp.class.spec]) associated with
the primary class template or primary variable template are considered when
a specialization based on the template <I>template-parameter</I> is
instantiated.

</BLOCKQUOTE>

<P>However, there is no explicit specification for how they are to be
handled, and the wording in 14.5.5 [temp.class.spec] and its
subsections explicitly applies only to partial specializations of
class templates.</P>

<BR><BR><HR><A NAME="549"></A><H4>549.
  
Non-deducible parameters in partial specializations
</H4><B>Section: </B>14.5.5.1&#160; [temp.class.spec.match]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin Sebor
 &#160;&#160;&#160;

 <B>Date: </B>18 November 2005<BR>


<P>In the following example, the template parameter in the partial
specialization is non-deducible:</P>

<PRE>
    template &lt;class T&gt; struct A { typedef T U; };
    template &lt;class T&gt; struct C { };
    template &lt;class T&gt; struct C&lt;typename A&lt;T&gt;::U&gt; { };
</PRE>

<P>Several compilers issue errors for this case, but there appears
to be nothing in the Standard that would make this ill-formed; it
simply seems that the partial specialization will never be matched,
so the primary template will be used for all specializations.
Should it be ill-formed?</P>

<P>(See also <A HREF="
     cwg_defects.html#1246">issue 1246</A>.)</P>

<P><B>Notes from the April, 2006 meeting:</B></P>

<P>It was noted that there are similar issues for constructors and
conversion operators with non-deducible parameters, and that they
should probably be dealt with similarly.</P>

<BR><BR><HR><A NAME="1755"></A><H4>1755.
  
Out-of-class partial specializations of member templates
</H4><B>Section: </B>14.5.5.3&#160; [temp.class.spec.mfunc]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-19<BR>




<P>According to 14.5.5.3 [temp.class.spec.mfunc] paragraph 2,</P>

<BLOCKQUOTE>

If a member template of a class template is partially specialized, the
member template partial specializations are member templates of the
enclosing class template; if the enclosing class template is instantiated
(14.7.1 [temp.inst], 14.7.2 [temp.explicit]), a declaration
for every member template partial specialization is also instantiated as
part of creating the members of the class template specialization.

</BLOCKQUOTE>

<P>Does this imply that only partial specializations of member templates
that are declared before the enclosing class is instantiated are
considered?  For example, in</P>

<PRE>
  template&lt;typename A&gt; struct X { template&lt;typename B&gt; struct Y; };
  template struct X&lt;int&gt;;
  template&lt;typename A&gt; template&lt;typename B&gt; struct X&lt;A&gt;::Y&lt;B*&gt; { int n; };
  int k = X&lt;int&gt;::Y&lt;int*&gt;().n;
</PRE>

<P>is the last line valid?  There is implementation variance on this
point.  Similarly, for an example like</P>

<PRE>
  template&lt;typename A&gt; struct Outer {
   template&lt;typename B, typename C&gt; struct Inner;
  };
  Outer&lt;int&gt; outer;
  template&lt;typename A&gt; template&lt;typename B&gt;
    struct Outer&lt;A&gt;::Inner&lt;typename A::error, B&gt; {};
</PRE>

<P>at what point, if at all, is the declaration of the partial
specialization instantiated?  Again, there is implementation variance in
the treatment of this example.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG decided that partial specialization declarations should be
instantiated only when needed to determine whether the partial
specialization matches or not.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>See also paper N4090.</P>

<BR><BR><HR><A NAME="1286"></A><H4>1286.
  
Equivalence of alias templates
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-03<BR>




<P><A HREF="
     cwg_defects.html#1244">Issue 1244</A> was resolved by changing the
example in 14.4 [temp.type] paragraph 1 from</P>

<PRE>
  template&lt;template&lt;class&gt; class TT&gt; struct X { };
  template&lt;class&gt; struct Y { };
  template&lt;class T&gt; using Z = Y&lt;T&gt;;
  X&lt;Y&gt; y;
  X&lt;Z&gt; z;
</PRE>

<P>to</P>

<PRE>
  template&lt;class T&gt; struct X { };
  template&lt;class&gt; struct Y { };
  template&lt;class T&gt; using Z = Y&lt;T&gt;;
  X&lt;Y&lt;int&gt; &gt; y;
  X&lt;Z&lt;int&gt; &gt; z;
</PRE>

<P>In fact, the original intent was that the example should have been
correct as written; however, the normative wording to make it so was
missing.  The current wording of 14.5.7 [temp.alias] deals
only with the equivalence of a specialization of an alias template
with the <I>type-id</I> after substitution.  Wording needs to be added
specifying under what circumstances an alias template itself is
equivalent to a class template.</P>

<P><B>Proposed resolution (September, 2012):</B></P>

<OL><LI><P>Add the following as a new paragraph following 14.5.7 [temp.alias] paragraph 2:</P></LI>

<BLOCKQUOTE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">When the <I>type-id</I> in the declaration of alias template (call
it <TT>A</TT>) consists of a <I>simple-template-id</I> in which the
<I>template-argument-list</I> consists of a list of <I>identifier</I>s
naming each <I>template-parameter</I> of <TT>A</TT> exactly once in
the same order in which they appear in <TT>A</TT>'s
<I>template-parameter-list</I>, the alias template is equivalent to
the template named in the <I>simple-template-id</I> (call it
<TT>T</TT>) if <TT>A</TT> and <TT>T</TT> have the same number of
<I>template-parameter</I>s. [<I>Footnote:</I> This rule is transitive:
if an alias template <TT>A</TT> is equivalent to another alias
template <TT>B</TT> that is equivalent to a class template <TT>C</TT>,
then <TT>A</TT> is also equivalent to <TT>C</TT>, and <TT>A</TT> and
<TT>B</TT> are also equivalent to each other. &#8212;<I>end
footnote</I>] [<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">  template&lt;typename T, U = T&gt; struct A;

  template&lt;typename V, typename W&gt;
    using B = A&lt;V, W&gt;;                //<SPAN style="font-family:Times;font-style:italic"> equivalent to </SPAN>A

  template&lt;typename V, typename W&gt;
    using C = A&lt;V&gt;;                   //<SPAN style="font-family:Times;font-style:italic"> not equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic">:</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> not all parameters used</SPAN>

  template&lt;typename V&gt;
    using D = A&lt;V&gt;;                   //<SPAN style="font-family:Times;font-style:italic"> not equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic">:</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> different number of parameters</SPAN>

  template&lt;typename V, typename W&gt;
    using E = A&lt;W, V&gt;;                //<SPAN style="font-family:Times;font-style:italic"> not equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic">:</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> template-arguments in wrong order</SPAN>

  template&lt;typename V, typename W = int&gt;
    using F = A&lt;V, W&gt;;                //<SPAN style="font-family:Times;font-style:italic"> equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic">:</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> default arguments not considered</SPAN>

  template&lt;typename V, typename W&gt;
    using G = A&lt;V, W&gt;;                //<SPAN style="font-family:Times;font-style:italic"> equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic"> and </SPAN>B

  template&lt;typename V, typename W&gt;
    using H = E&lt;V, W&gt;;                //<SPAN style="font-family:Times;font-style:italic"> equivalent to </SPAN>E

  template&lt;typename V, typename W&gt;
    using I = A&lt;V, typename W::type&gt;; //<SPAN style="font-family:Times;font-style:italic"> not equivalent to </SPAN>A<SPAN style="font-family:Times;font-style:italic">:</SPAN>
                                      //<SPAN style="font-family:Times;font-style:italic"> argument not identifier</SPAN></SPAN>

</PRE>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">&#8212;<I>end example</I>]</SPAN></P>

</BLOCKQUOTE>

<LI><P>Change 14.4 [temp.type] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

<P>Two <I>template-id</I>s refer to the same class or function if</P>

<UL><LI><P>...</P></LI>

<LI><P>their corresponding template <I>template-argument</I>s refer to
the same <SPAN style="font-weight:bold;background-color:#A0FFA0">or equivalent (14.5.7 [temp.alias])</SPAN>
template<SPAN style="font-weight:bold;background-color:#A0FFA0">s</SPAN>.
</P></LI>

</UL>

<P>[<I>Example:</I></P>

<P>...declares <TT>x2</TT> and <TT>x3</TT> to be of the same type. Their type differs from the types of <TT>x1</TT> and <TT>x4</TT>.</P>

<PRE>
  template&lt;<SPAN style="text-decoration:line-through;background-color:#FFA0A0">class T</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">template&lt;class&gt; class TT</SPAN>&gt; struct X { };
  template&lt;class&gt; struct Y { };
  template&lt;class T&gt; using Z = Y&lt;T&gt;;
  X&lt;<SPAN style="text-decoration:line-through;background-color:#FFA0A0">Y&lt;int&gt;</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">Y</SPAN>&gt; y;
  X&lt;<SPAN style="text-decoration:line-through;background-color:#FFA0A0">Z&lt;int&gt;</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">Z</SPAN>&gt; z;
</PRE>

<P>declares <TT>y</TT> and <TT>z</TT> to be of the same type.
&#8212;<I>end example</I>]</P>

</BLOCKQUOTE>

</OL>

<P><B>Additional note, November, 2014:</B></P>

<P>Concern has been expressed over the proposed resolution with
regard to its handling of default template arguments that differ
between the template and its alias, e.g.,</P>

<PRE>
   template&lt;typename T, typename U = int&gt; struct A {};
   template&lt;typename T, typename U = char&gt; using B = A&lt;T, U&gt;;
   template&lt;template&lt;typename...&gt; typename C&gt; struct X { C&lt;int&gt; c; };
</PRE>



<BR><BR><HR><A NAME="1430"></A><H4>1430.
  
Pack expansion into fixed alias template parameter list
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2011-12-13<BR>




<P>Originally, a pack expansion could not expand into a
fixed-length template parameter list, but this was changed in
N2555.  This works fine for most templates, but causes issues
with alias templates.</P>

<P>In most cases, an alias template is transparent; when it's
used in a template we can just substitute in the dependent
template arguments.  But this doesn't work if the
<I>template-id</I> uses a pack expansion for non-variadic
parameters.  For example:</P>

<PRE>
    template&lt;class T, class U, class V&gt;
    struct S {};

    template&lt;class T, class V&gt;
    using A = S&lt;T, int, V&gt;;

    template&lt;class... Ts&gt;
    void foo(A&lt;Ts...&gt;);
</PRE>

<P>There is no way to express <TT>A&lt;Ts...&gt;</TT> in terms of
<TT>S</TT>, so we need to hold onto the <TT>A</TT> until we have
the <TT>Ts</TT> to substitute in, and therefore it needs to be
handled in mangling.</P>

<P>Currently, EDG and Clang reject this testcase, complaining
about too few template arguments for A.  G++ did as well, but I
thought that was a bug.  However, on the ABI list John Spicer
argued that it should be rejected.</P>

<P>(See also <A HREF="
     cwg_defects.html#1558">issue 1558</A>.)</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The consensus of CWG was that this usage should be prohibited,
disallowing use of an alias template when a dependent argument can't
simply be substituted directly into the <I>type-id</I>.</P>

<P><B>Additional note, April, 2013:</B></P>

<P>For another example, consider:</P>

<PRE>
  template&lt;class... x&gt; class list{};
  template&lt;class a, class... b&gt; using tail=list&lt;b...&gt;;
  template &lt;class...T&gt; void f(tail&lt;T...&gt;);

  int main() {
    f&lt;int,int&gt;({});
  }
</PRE>

<P>There is implementation variance in the handling of this
example. </P>

<BR><BR><HR><A NAME="1554"></A><H4>1554.
  
Access and alias templates
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2012-09-17<BR>




<P>The interaction of alias templates and access control is not clear
from the current wording of 14.5.7 [temp.alias].  For
example:</P>

<PRE>
  template &lt;class T&gt; using foo = typename T::foo;

  class B {
    typedef int foo;
    friend struct C;
  };

  struct C {
    foo&lt;B&gt; f;    //<SPAN style="font-family:Times;font-style:italic"> Well-formed?</SPAN>
  };
</PRE>

<P>Is the substitution of <TT>B::foo</TT> for <TT>foo&lt;B&gt;</TT>
done in the context of the befriended class <TT>C</TT>, making the
reference well-formed, or is the access determined independently of
the context in which the alias template specialization appears?</P>

<P>If the answer to this question is that the access is determined
independently from the context, care must be taken to ensure that an
access failure is still considered to be &#8220;in the immediate
context of the function type&#8221; (14.8.2 [temp.deduct]
paragraph 8) so that it results in a deduction failure rather than
a hard error.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The consensus of CWG was that instantiation (lookup and access)
for alias templates should be as for other templates, in the definition
context rather than in the context where they are used.  They should
still be expanded immediately, however.</P>

<P><B>Additional note (February, 2014):</B></P>

<P>A related problem is raised by the definition of
<TT>std::enable_if_t</TT> (20.10.2 [meta.type.synop]):</P>

<PRE>
  template &lt;bool b, class T = void&gt;
  using enable_if_t = typename enable_if&lt;b,T&gt;::type;
</PRE>

<P>If <TT>b</TT> is <TT>false</TT>, there will be no <TT>type</TT>
member.  The intent is that such a substitution failure is to be
considered as being &#8220;in the immediate context&#8221; where the
alias template specialization is used, but the existing wording does
not seem to accomplish that goal.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>Concern has been expressed  that the intent to analyze
access in the context of the alias template definition is at odds
with the fact that friendship cannot be granted to alias
templates; if it could, the access violation in the original example
could be avoided by making <TT>foo</TT> a friend of class <TT>B</TT>,
but that is not possible.</P>

<BR><BR><HR><A NAME="1896"></A><H4>1896.
  
Repeated alias templates
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-18<BR>


<P>The current wording of the Standard does not permit repeated
alias template declarations within a scope, but some current
implementations allow it, presumably by analogy with typedef
declarations.  Should the Standard be changed to permit this usage?</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG agreed that the usage should be permitted, provided that
the dependent types are equivalent.  Note that this is a weaker
requirement than the token-for-token identity of the ODR, since
alias templates are not definitions per 14 [temp]
paragraph 1.</P>

<BR><BR><HR><A NAME="1980"></A><H4>1980.
  
Equivalent but not functionally-equivalent redeclarations
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-04<BR>




<P>In an example like</P>

<PRE>
  template&lt;typename T, typename U&gt; using X = T;
  template&lt;typename T&gt; X&lt;void, typename T::type&gt; f();
  template&lt;typename T&gt; X&lt;void, typename T::other&gt; f();
</PRE>

<P>it appears that the second declaration of <TT>f</TT> is a
redeclaration of the first but distinguishable by SFINAE, i.e.,
equivalent but not functionally equivalent.</P>

<P><B>Notes from the November, 2014 meeting:</B></P>

<P>CWG felt that these two declarations should not be equivalent.</P>

<BR><BR><HR><A NAME="560"></A><H4>560.
  
Use of the <TT>typename</TT> keyword in return types
</H4><B>Section: </B>14.6&#160; [temp.res]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Greg Comeau
 &#160;&#160;&#160;

 <B>Date: </B>11 February 2006<BR>


<P>Consider the following example:</P>

<PRE>
    template &lt;class T&gt; struct Outer {
        struct Inner {
            Inner* self();
        };
    };
    template &lt;class T&gt; Outer&lt;T&gt;::Inner*
        Outer&lt;T&gt;::Inner::self() { return this; }
</PRE>

<P>According to 14.6 [temp.res] paragraph 3 (before the
salient wording was inadvertently removed, see
<A HREF="
     cwg_defects.html#559">issue 559</A>),</P>

<BLOCKQUOTE>

A <I>qualified-id</I> that refers to a type and in which the
<I>nested-name-specifier</I> depends on a <I>template-parameter</I>
(14.6.2 [temp.dep]) but does not refer to a member of the
current instantiation (14.6.2.1 [temp.dep.type]) shall be
prefixed by the keyword <TT>typename</TT> to indicate that
the <I>qualified-id</I> denotes a type, forming
a <I>typename-specifier</I>.

</BLOCKQUOTE>

<P>Because <TT>Outer&lt;T&gt;::Inner</TT> is a member of the current
instantiation, the Standard does not currently require that it be
prefixed with <TT>typename</TT> when it is used in the return type of
the definition of the <TT>self()</TT> member function.  However, it is
difficult to parse this definition correctly without knowing that the
return type is, in fact, a type, which is what the <TT>typename</TT>
keyword is for.  Should the Standard be changed to require
<TT>typename</TT> in such contexts?</P>



<BR><BR><HR><A NAME="1271"></A><H4>1271.
  
Imprecise wording regarding dependent types
</H4><B>Section: </B>14.6&#160; [temp.res]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-24<BR>


<P>According to 14.6 [temp.res] paragraph 3,</P>

<BLOCKQUOTE>

When a <I>qualified-id</I> is intended to refer to a type that is not
a member of the current instantiation (14.6.2.1 [temp.dep.type])
and its <I>nested-name-specifier</I> refers to a dependent type, it
shall be prefixed by the keyword <TT>typename</TT>, forming a
<I>typename-specifier</I>.  If the <I>qualified-id</I> in a
<I>typename-specifier</I> does not denote a type, the program is ill-
formed.

</BLOCKQUOTE>

<P>The intent of the programmer cannot form the basis for a compiler
determining whether to issue a diagnostic or not.</P>

<U>Suggested resolution:</U>

<BLOCKQUOTE>

<P>Let <TT>N</TT> be a <I>qualified-id</I> with a
<I>nested-name-specifier</I> that denotes a dependent type.  If
<TT>N</TT> is not prefixed by the keyword <TT>typename</TT>, <TT>N</TT>
shall refer to a member of the current instantiation or it shall not
refer to a type.</P>

<UL><I>typename-specifier:</I>
<UL><TT>typename</TT> <I>nested-name-specifier identifier</I><BR>
<TT>typename</TT> <I>nested-name-specifier </I><TT>template</TT><I><SUB>opt</SUB> simple-template-id</I></UL>
</UL>

<P>If the <I>qualified-id</I> in a <I>typename-specifier</I> does not
denote a type, the program is ill-formed.</P>

</BLOCKQUOTE>

<P>(See also issues <A HREF="
     cwg_defects.html#590">590</A> and
<A HREF="
     cwg_defects.html#591">591</A>.)</P>

<BR><BR><HR><A NAME="1785"></A><H4>1785.
  
Conflicting diagnostic requirements for template definitions
</H4><B>Section: </B>14.6&#160; [temp.res]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-28<BR>


<P>According to 14.6 [temp.res] paragraph 8,</P>

<BLOCKQUOTE>

No diagnostic shall be issued for a template for which a valid
specialization can be generated.

</BLOCKQUOTE>

<P>One sentence later, it says,</P>

<BLOCKQUOTE>

If every valid specialization of a variadic template requires an empty
template parameter pack, the template is ill-formed, no diagnostic
required.

</BLOCKQUOTE>

<P>This appears to be a contradiction: in the latter case, there is
postulated to exist a &#8220;valid&#8221; specialization (with an empty
pack expansion), for which a diagnostic might or might not be issued.  The
first quoted sentence, however, forbids issuing a diagnostic for a template
that has at least one valid specialization.</P>



<BR><BR><HR><A NAME="1841"></A><H4>1841.
  
<TT>&lt;</TT> following template injected-class-name
</H4><B>Section: </B>14.6.1&#160; [temp.local]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Ismail Pazarbasi
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-23<BR>




<P>According to 14.6.1 [temp.local]paragraph 1,</P>

<BLOCKQUOTE>

Like normal (non-template) classes, class templates have an
injected-class-name (Clause 9 [class]). The
injected-class-name can be used as a <I>template-name</I> or
a <I>type-name</I>. When it is used with a <I>template-argument-list</I>,
as a <I>template-argument</I> for a template <I>template-parameter</I>, or
as the final identifier in the <I>elaborated-type-specifier</I> of a friend
class template declaration, it refers to the class template
itself. Otherwise, it is equivalent to the <I>template-name</I> followed by
the <I>template-parameter</I>s of the class template enclosed in &lt;&gt;.

</BLOCKQUOTE>

<P>The intent is that a <TT>&lt;</TT> following such an
injected-class-name is to be interpreted as the start of a
<I>template-argument-list</I> (and an error if the following tokens
do not constitute a valid <I>template-argument-list</I>), but that
is not said explicitly.</P>

<BR><BR><HR><A NAME="1936"></A><H4>1936.
  
Dependent <I>qualified-id</I>s
</H4><B>Section: </B>14.6.2&#160; [temp.dep]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-05<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#1321">issue 1321</A> changed
the term &#8220;dependent name&#8221; to apply only to
<I>unqualified-id</I>s, presumably on the basis that only
<I>unqualified-id</I>s affect the lookup set.  However, the
rule from 14.5.6.1 [temp.over.link] paragraph 5,</P>

<BLOCKQUOTE>

For determining whether two dependent names (14.6.2 [temp.dep])
are equivalent, only the name itself is considered, not the result of name
lookup in the context of the template. If multiple declarations of the same
function template differ in the result of this name lookup, the result for
the first declaration is used.

</BLOCKQUOTE>

<P>should apply to non-dependent <I>qualified-id</I>s naming
functions called with dependent arguments, as well.</P>

<P>There should also be a statement that the name of a member
of an unknown specialization is a dependent name and so should
fall under the rules of 14.6.4 [temp.dep.res] and not
14.6.3 [temp.nondep].</P>

<BR><BR><HR><A NAME="1390"></A><H4>1390.
  
Dependency of alias template specializations
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-09-04<BR>




<P>According to 14.6.2.1 [temp.dep.type] paragraph 8, a type
is dependent (among other things) if it is</P>

<UL><LI><P>a <I>simple-template-id</I> in which either the
template name is a template parameter or any of the template
arguments is a dependent type or an expression that is
type-dependent or value-dependent</P></LI></UL>

<P>This applies to alias template specializations, even if the
resulting type does not depend on the template argument:</P>

<PRE>
    struct B { typedef int type; };
    template&lt;typename&gt; using foo = B;
    template&lt;typename T&gt; void f() {
      foo&lt;T&gt;::type * x;  //<SPAN style="font-family:Times;font-style:italic">error: </SPAN><TT>typename</TT><SPAN style="font-family:Times;font-style:italic"> required</SPAN>
    }
</PRE>

<P>Is a change to the rules for cases like this warranted?</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>CWG agreed that no <TT>typename</TT> should be required in this
case.  In some ways, an alias template specialization is like the current
instantiation and can be known at template definition time.</P>

<BR><BR><HR><A NAME="1524"></A><H4>1524.
  
Incompletely-defined class template base
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2012-07-17<BR>




<P>The correct handling of an example like the following is unclear:</P>

<PRE>
  template&lt;typename T&gt; struct A {
    struct B: A { };
  };
</PRE>

<P>A type used as a base must be complete (10 [class.derived]
paragraph 2).  The fact that the base class in this example is the
current instantiation could be interpreted as indicating that it
should be available for lookup, and thus the normal rule should apply,
as members declared after the nested class would not be visible.</P>

<P>On the other hand, 14.6.2 [temp.dep] paragraph 3
says,</P>

<BLOCKQUOTE>

In the definition of a class or class template, if a base class
depends on a <I>template-parameter</I>, the base class scope is not
examined during unqualified name lookup either at the point of
definition of the class template or member or during an instantiation
of the class template or member.

</BLOCKQUOTE>

<P>This wording refers not to a dependent type, which would permit
lookup in the current instantiation, but simply to a type that
&#8220;depends on a <I>template-parameter</I>,&#8221; and the current
instantiation is such a type.</P>

<P>Implementations vary on the handling of this example.</P>

<P>(See also <A HREF="
     cwg_closed.html#1526">issue 1526</A> for another case
related to the distinction between a &#8220;dependent type&#8221; and
a &#8220;type that depends on a <I>template-parameter</I>.&#8221;)</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>CWG determined that the example should be ill-formed.</P>

<BR><BR><HR><A NAME="2"></A><H4>2.
  
How can dependent names be used in member declarations that appear outside of the class template definition?
</H4><B>Section: </B>14.6.4&#160; [temp.dep.res]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>unknown
 &#160;&#160;&#160;

 <B>Date: </B>unknown<BR>





<PRE>
    template &lt;class T&gt; class Foo {
    
       public:
       typedef int Bar;
       Bar f();
    };
    template &lt;class T&gt; typename Foo&lt;T&gt;::Bar Foo&lt;T&gt;::f() { return 1;}
                       --------------------
</PRE>
In the class template definition, the declaration of the member function
is interpreted as:
<PRE>
   int Foo&lt;T&gt;::f();
</PRE>
In the definition of the member function that appears outside of the class
template, the return type is not known until the member function
is instantiated.
Must the return type of the member function be known when this out-of-line
definition is seen (in which case the definition above is ill-formed)?
Or is it OK to wait until the member function is instantiated to see if
the type of the return type matches the return type in the class template
definition (in which case the definition above is well-formed)?
    
<P><B>Suggested resolution:</B> (John Spicer)</P>
    
<P>My opinion (which I think matches several posted on the reflector recently)
is that the out-of-class definition must match the
declaration in the template. 
In your example they do match, so it is well formed.</P>
    
<P>I've added some additional cases that illustrate cases that I think
either are allowed or should be allowed, and some cases that I don't think
are allowed.</P>
<PRE>
    template &lt;class T&gt; class A { typedef int X; };
    
    
    template &lt;class T&gt; class Foo {
     public:
       typedef int Bar;
       typedef typename A&lt;T&gt;::X X;
       Bar f();
       Bar g1();
       int g2();
       X h();
       X i();
       int j();
     };
    
     // Declarations that are okay
     template &lt;class T&gt; typename Foo&lt;T&gt;::Bar Foo&lt;T&gt;::f()
                                                     { return 1;}
     template &lt;class T&gt; typename Foo&lt;T&gt;::Bar Foo&lt;T&gt;::g1()
                                                     { return 1;}
     template &lt;class T&gt; int Foo&lt;T&gt;::g2() { return 1;}
     template &lt;class T&gt; typename Foo&lt;T&gt;::X Foo&lt;T&gt;::h() { return 1;}
    
     // Declarations that are not okay
     template &lt;class T&gt; int Foo&lt;T&gt;::i() { return 1;}
     template &lt;class T&gt; typename Foo&lt;T&gt;::X Foo&lt;T&gt;::j() { return 1;}
</PRE>
In general, if you can match the declarations up using only information
from the template, then the declaration is valid.

<P>Declarations like <TT>Foo::i</TT> and <TT>Foo::j </TT>are invalid because
for a given instance of <TT>A&lt;T&gt;</TT>, <TT>A&lt;T&gt;::X</TT> may not actually
be int if the class is specialized.</P>

<P>This is not a problem for <TT>Foo::g1</TT> and <TT>Foo::g2</TT> because
for any instance of <TT>Foo&lt;T&gt;</TT> that is generated from the template
you know that Bar will always be int. If an instance of <TT>Foo</TT> is
specialized, the template member definitions are not used so it doesn't
matter whether a specialization defines <TT>Bar</TT> as int or not.</P>


<BR><BR><HR><A NAME="287"></A><H4>287.
  
Order dependencies in template instantiation
</H4><B>Section: </B>14.6.4.1&#160; [temp.point]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin Sebor
 &#160;&#160;&#160;

 <B>Date: </B>17 May 2001<BR>




<P>Implementations differ in their treatment of the following
code:</P>

<PRE>
    template &lt;class T&gt;
    struct A {
	typename T::X x;
    };

    template &lt;class T&gt;
    struct B {
	typedef T* X;
	A&lt;B&gt; a;
    };

    int main ()
    {
	B&lt;int&gt; b;
    }
</PRE>

<P>Some implementations accept it.  At least one rejects it
because the instantiation of <TT>A&lt;B&lt;int&gt; &gt;</TT>
requires that <TT>B&lt;int&gt;</TT> be complete, and it is
not at the point at which <TT>A&lt;B&lt;int&gt; &gt;</TT>
is being instantiated.</P>

<P><U>Erwin Unruh</U>:</P>

<P>In my view the programm is ill-formed. My reasoning:</P>

<UL>

<LI>you need a complete type <TT>B&lt;int&gt;</TT> because you declare
a variable in <TT>main</TT></LI>

<LI><TT>B&lt;int&gt;</TT> contains a member of type
<TT>A&lt;B&lt;int&gt; &gt;</TT>, so you need that complete.</LI>

<LI><TT>A&lt;B&lt;int&gt; &gt;</TT> tries to access
<TT>B&lt;int&gt;::X</TT>, which in turn needs <TT>B&lt;int&gt;</TT>
being complete.</LI>

</UL>

<P>So each class needs the other to be complete.</P>

<P>The problem can be seen much easier if you replace the typedef with</P>
<PRE>
    typedef T (*X) [sizeof(B::a)];
</PRE>

<P>Now you have a true recursion. The compiler cannot easily distinguish
between a true recursion and a potential recursion.</P>

<P><U>John Spicer</U>:</P>

<P>Using a class to form a qualified name does not require the class to be
complete, it only requires that the named member already have been declared.
In other words, this kind of usage is permitted:</P>

<PRE>
    class A {
        typedef int B;
        A::B ab;
    };
</PRE>

<P>In the same way, once <TT>B</TT> has been declared in <TT>A</TT>,
it is also visible to any template that uses <TT>A</TT> through a
template parameter.</P>

<P>The standard could be more clear in this regard, but there are two
notes that make this point.  Both 3.4.3.1 [class.qual] and
5.1.1 [expr.prim.general] paragraph 7 contain a note that says "a
class member can be referred to using a qualified-id at any point in
its potential scope (3.3.7 [basic.scope.class])."  A member's
potential scope begins at its point of declaration.</P>

<P>In other words, a class has three states: incomplete, being
completed, and complete.  The standard permits a qualified name to be
used once a name has been declared.  The quotation of the notes about
the potential scope was intended to support that.</P>

<P>So, in the original example, class <TT>A</TT> does not require the
type of <TT>T</TT> to be complete, only that it have already declared
a member <TT>X</TT>.</P>

<P><U>Bill Gibbons</U>:</P>

<P>The template and non-template cases are different.  In the non-template
case the order in which the members become declared is clear.  In the
template case the members of the instantiation are conceptually all
created at the same time.  The standard does not say anything about
trying to mimic the non-template case during the instantiation of a class
template.</P>

<P><U>Mike Miller</U>:</P>

<P>I think the relevant specification is 14.6.4.1 [temp.point] paragraph 3, dealing with the point of
instantiation:</P>

<BLOCKQUOTE>

For a class template specialization... if the specialization is
implicitly instantiated because it is referenced from within
another template specialization, if the context from which the
specialization is referenced depends on a template parameter, and
if the specialization is not instantiated previous to the
instantiation of the enclosing template, the point of
instantiation is immediately before the point of instantiation
of the enclosing template.  Otherwise, the point of instantiation
for such a specialization immediately precedes the namespace scope
declaration or definition that refers to the specialization.

</BLOCKQUOTE>

<P>That means that the point of instantiation of <TT>A&lt;B&lt;int&gt;
&gt;</TT> is before that of <TT>B&lt;int&gt;</TT>, not in the middle
of <TT>B&lt;int&gt;</TT> after the declaration of <TT>B::X</TT>, and
consequently a reference to <TT>B&lt;int&gt;::X</TT> from
<TT>A&lt;B&lt;int&gt; &gt;</TT> is ill-formed.</P>

<P>To put it another way, I believe John's approach requires that there
be an instantiation stack, with the results of partially-instantiated
templates on the stack being available to instantiations above them.
I don't think the Standard mandates that approach; as far as I can
see, simply determining the implicit instantiations that need to be
done, rewriting the definitions at their respective points of
instantiation with parameters substituted (with appropriate "forward
declarations" to allow for non-instantiating references), and
compiling the result normally should be an acceptable implementation
technique as well.  That is, the implicit instantiation of the
example (using, e.g., <TT>B_int</TT> to represent the generated name of the
<TT>B&lt;int&gt;</TT> specialization) could be something like</P>

<PRE>
        struct B_int;

        struct A_B_int {
            B_int::X x;    // error, incomplete type
        };

        struct B_int {
            typedef int* X;
            A_B_int a;
        };
</PRE>

<P><B>Notes from 10/01 meeting:</B></P>

<P>This was discussed at length.  The consensus was that the template case
should be treated the same as the non-template class case it terms of
the order in which members get declared/defined and classes get completed.</P>

<P><B>Proposed resolution:</B></P>

<P>
In 14.6.4.1 [temp.point] paragraph 3 change:</P>
<BLOCKQUOTE>
the point of instantiation is immediately before the point of
instantiation of the enclosing template. Otherwise, the point of
instantiation for such a specialization immediately precedes the
namespace scope declaration or definition that refers to the
specialization.
</BLOCKQUOTE>
<P> To:</P>
<BLOCKQUOTE>
the point of instantiation is <SPAN style="font-weight:bold;background-color:#A0FFA0">the same as</SPAN> the point of
instantiation of the enclosing template. Otherwise, the point of
instantiation for such a specialization immediately precedes the
<SPAN style="font-weight:bold;background-color:#A0FFA0">nearest enclosing declaration</SPAN>.
<SPAN style="font-weight:bold;background-color:#A0FFA0">[Note: The point of instantiation is still at namespace scope but
any declarations preceding the point of instantiation, even if not
at namespace scope, are considered to have been seen.]</SPAN>
</BLOCKQUOTE>

<P> Add following paragraph 3:</P>
<BLOCKQUOTE>
If an implicitly instantiated class template specialization, class
member specialization, or specialization of a class template references
a class, class template specialization, class member specialization, or
specialization of a class template containing a specialization reference
that directly or indirectly caused the instantiation, the requirements
of completeness and ordering of the class reference are applied in the
context of the specialization reference.
</BLOCKQUOTE>

<P>and the following example</P>

<PRE>
  template &lt;class T&gt; struct A {
          typename T::X x;
  };

  struct B {
          typedef int X;
          A&lt;B&gt; a;
  };

  template &lt;class T&gt; struct C {
          typedef T* X;
          A&lt;C&gt; a;
  };

  int main ()
  {
          C&lt;int&gt; c;
  }
</PRE>

<P><B>Notes from the October 2002 meeting:</B></P>

<P>This needs work.  Moved back to drafting status.</P>

<P>See also issues <A HREF="
     cwg_closed.html#595">595</A> and
<A HREF="
     cwg_defects.html#1330">1330</A>.</P>

<BR><BR><HR><A NAME="1258"></A><H4>1258.
  
&#8220;Instantiation context&#8221; differs from dependent lookup rules
</H4><B>Section: </B>14.6.4.1&#160; [temp.point]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-10<BR>




<P>C++11 expanded the lookup rules for dependent function calls
(14.6.4.2 [temp.dep.candidate] paragraph 1 bullet 2) to include functions
with internal linkage; previously only functions with external linkage
were considered.  However, 14.6.4.1 [temp.point] paragraph 6
still says,</P>

<BLOCKQUOTE>

The instantiation context of an expression that depends on the
template arguments is the set of declarations with external linkage
declared prior to the point of instantiation of the template
specialization in the same translation unit.

</BLOCKQUOTE>

<P>Presumably this wording was overlooked and should be harmonized with
the new specification.</P>

<BR><BR><HR><A NAME="1845"></A><H4>1845.
  
Point of instantiation of a variable template specialization
</H4><B>Section: </B>14.6.4.1&#160; [temp.point]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-28<BR>


<P>The current wording of 14.6.4.1 [temp.point] does not
define the point of instantiation of a variable template
specialization.  Presumably replacing the references to &#8220;static
data member of a class template&#8221; with &#8220;variable
template&#8221; in paragraphs 1 and 8 would be sufficient.</P>

<BR><BR><HR><A NAME="1253"></A><H4>1253.
  
Generic non-template members
</H4><B>Section: </B>14.7&#160; [temp.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-06<BR>




<P>Many statements in the Standard apply only to templates, for example,
14.6 [temp.res] paragraph 8:</P>

<BLOCKQUOTE>

If no valid specialization can be generated for a template definition,
and that template is not instantiated, the template definition is
ill-formed, no diagnostic required.

</BLOCKQUOTE>

<P>This clearly should apply to non-template member functions of class
templates, not just to templates per se.  Terminology should be established
to refer to these generic entities that are not actually templates.</P>

<P><B>Additional notes (August, 2012):</B></P>

<P>Among the generic entities that should be covered by such a term
are default function arguments, as they can be instantiated independently.
If <A HREF="
     cwg_defects.html#1330">issue 1330</A> is resolved as expected,
<I>exception-specification</I>s should also be covered by the same term.
</P>

<P>See also <A HREF="
     cwg_defects.html#1484">issue 1484</A>.</P>

<BR><BR><HR><A NAME="212"></A><H4>212.
  
Implicit instantiation is not described clearly enough
</H4><B>Section: </B>14.7.1&#160; [temp.inst]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Christophe de Dinechin
 &#160;&#160;&#160;

 <B>Date: </B>7 Mar 2000<BR>




<P>Three points have been raised where the wording in
14.7.1 [temp.inst] may not be sufficiently clear.</P>

<OL>

<LI>

In paragraph 4, the statement is made that

<BLOCKQUOTE>

A class template specialization is implicitly instantiated...  if the
completeness of the class type affects the semantics of the program...

</BLOCKQUOTE>

<P>It is not clear what it means for the "completeness... [to affect]
the semantics."  Consider the following example:</P>

<PRE>
        template&lt;class T&gt; struct A;
        extern A&lt;int&gt; a;

        void *foo() { return &amp;a; }

        template&lt;class T&gt; struct A
        {
        #ifdef OPTION
                void *operator &amp;() { return 0; }
        #endif
        };
</PRE>

<P>The question here is whether it is necessary for template class
<TT>A</TT> to declare an <TT>operator &amp;</TT> for the semantics of the
program to be affected.  If it does not do so, the meaning of
<TT>&amp;a</TT> will be the same whether the class is complete or
not and thus arguably the semantics of the program are not
affected.</P>

<P>Presumably what was intended is whether the presence or absence of
certain member declarations in the template class might be relevant in
determining the meaning of the program.  A clearer statement may be
desirable.</P>

</LI>

<LI>

Paragraph 5 says,

<BLOCKQUOTE>

If the overload resolution process can determine the correct function
to call without instantiating a class template definition, it is
unspecified whether that instantiation actually takes place.

</BLOCKQUOTE>

<P>The intent of this wording, as illustrated in the example in that
paragraph, is to allow a "smart" implementation not to instantiate
class templates if it can determine that such an instantiation will
not affect the result of overload resolution, even though the
algorithm described in clause 13 [over] requires that
all the viable functions be enumerated, including functions that might
be found as members of specializations.</P>

<P>Unfortunately, the looseness of the wording allowing this latitude
for implementations makes it unclear what "the overload resolution
process" is &#8212; is it the algorithm in 13 [over] or
something else? &#8212; and what "the correct function" is.</P>

</LI>

<LI>

According to paragraph 6,

<BLOCKQUOTE>

If an implicit instantiation of a class template specialization is
required and the template is declared but not defined, the program is
ill-formed.

</BLOCKQUOTE>

<P>Here, it is not clear what conditions "require" an implicit
instantiation.  From the context, it would appear that the intent is
to refer to the conditions in paragraph 4 that cause a specialization
to be instantiated.</P>

<P>This interpretation, however, leads to different treatment of
template and non-template incomplete classes.  For example, by this
interpretation,</P>

<PRE>
    class A;
    template &lt;class T&gt; struct TA;
    extern A a;
    extern TA&lt;int&gt; ta;

    void f(A*);
    void f(TA&lt;int&gt;*);

    int main()
    {
        f(&amp;a);    // well-formed; undefined if A
                  // has operator &amp;() member
        f(&amp;ta);   // ill-formed: cannot instantiate
    }
</PRE>

<P>A different approach would be to understand "required" in paragraph
6 to mean that a complete type is required in the expression.  In this
interpretation, if an incomplete type is acceptable in the context and
the class template definition is not visible, the instantiation is not
attempted and the program is well-formed.</P>

<P>The meaning of "required" in paragraph 6 must be clarified.</P>

</LI>

</OL>

<P>(See also issues <A HREF="
     cwg_defects.html#204">204</A> and
<A HREF="
     cwg_defects.html#63">63</A>.)</P>

<P><B>Notes on 10/01 meeting:</B></P>

<P>It was felt that item 1 is solved by addition of the word "might"
in the resolution for <A HREF="
     cwg_defects.html#63">issue 63</A>; item 2
is not much of a problem; and item 3 could be solved by changing
"required" to "required to be complete".</P>

<BR><BR><HR><A NAME="1396"></A><H4>1396.
  
Deferred instantiation and checking of non-static data member initializers
</H4><B>Section: </B>14.7.1&#160; [temp.inst]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2011-09-22<BR>




<P>Non-static data member initializers get the same late parsing
as member functions and default arguments, but are they also
instantiated as needed like them?  And when is their validity
checked?</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>CWG agreed that non-static data member initializers should be handled
like default arguments.</P>

<P><B>Additional note (March, 2013):</B></P>

<P>Determining whether a defaulted constructor is <TT>constexpr</TT> or
not requires parsing the class's non-static data member initializers;
see also <A HREF="
     cwg_active.html#1360">issue 1360</A>.</P>

<BR><BR><HR><A NAME="1665"></A><H4>1665.
  
Declaration matching in explicit instantiations
</H4><B>Section: </B>14.7.2&#160; [temp.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-19<BR>




<P>Consider a case like</P>

<PRE>
  struct X {
    template&lt;typename T&gt; void f(T);
    void f(int);
  };
  template void X::f(int);
</PRE>

<P>or</P>

<PRE>
  template&lt;typename T&gt; void f(T) {}
  void f(int);
  template void f(int);
</PRE>

<P>Presumably in both these cases the explicit instantiation should
refer to the template and not to the non-template; however,
14.5.2 [temp.mem] paragraph 2 says,</P>

<BLOCKQUOTE>

A normal (non-template) member function with a given name and type and a
member function template of the same name, which could be used to generate
a specialization of the same type, can both be declared in a class. When
both exist, a use of that name and type refers to the non-template member
unless an explicit template argument list is supplied.

</BLOCKQUOTE>

<P>This would appear to give the wrong answer for the first example.
It's not clearly stated, but consistency would suggest a similar wrong
answer for the second.  Presumably a statement is needed somewhere that
an explicit instantiation directive applies to a template and not a
non-template function if both are visible.</P>

<P><B>Additional note, January, 2014:</B></P>

<P>A related example has been raised:</P>

<PRE>
  template&lt;typename T&gt; class Matrix {
  public:
    Matrix(){}
    Matrix(const Matrix&amp;){}
    template&lt;typename U&gt;
      Matrix(const Matrix&lt;U&gt;&amp;);
  };

  template Matrix&lt;int&gt;::Matrix(const Matrix&amp;);

  Matrix&lt;int&gt; m;
  Matrix&lt;int&gt; mm(m);
</PRE>

<P>If the explicit instantiation directive applies to the
constructor template, there is no way to explicitly instantiate
the copy constructor.</P>

<BR><BR><HR><A NAME="1704"></A><H4>1704.
  
Type checking in explicit instantiation of variable templates
</H4><B>Section: </B>14.7.2&#160; [temp.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-20<BR>




<P>It is not clear whether the following is well-formed or not:</P>

<PRE>
  template&lt;typename T&gt; int arr[sizeof(T)] = {};
  template int arr&lt;int&gt;[];
</PRE>

<P>Are we supposed to instantiate the specialization and treat the explicit
instantiation declaration as if it were a redeclaration (in which case the
omitted array bound would presumably be OK), or is the type of the explicit
instantiation declaration required to exactly match the type that the
instantiated specialization has (in which case the omitted bound would
presumably not be OK)? Or something else?</P>

<P>(See also <A HREF="
     cwg_active.html#1728">issue 1728</A>.)</P>

<BR><BR><HR><A NAME="1728"></A><H4>1728.
  
Type of an explicit instantiation of a variable template
</H4><B>Section: </B>14.7.2&#160; [temp.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Larisse Voufo
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-05<BR>




<P>It is not clear to what extent the type in an explicit instantiation
must match that of a variable template.  For example:</P>

<PRE>
  template&lt;typename T&gt; T var = T();
  template float var&lt;float&gt;;   //<SPAN style="font-family:Times;font-style:italic"> #1.</SPAN>
  template int* var&lt;int&gt;;      //<SPAN style="font-family:Times;font-style:italic"> #2.</SPAN>
  template auto var&lt;char&gt;;     //<SPAN style="font-family:Times;font-style:italic"> #3.</SPAN>
</PRE>

<P>(See also <A HREF="
     cwg_active.html#1704">issue 1704</A>.)</P>

<BR><BR><HR><A NAME="529"></A><H4>529.
  
Use of <TT>template&lt;&gt;</TT> with &#8220;explicitly-specialized&#8221; class templates
</H4><B>Section: </B>14.7.3&#160; [temp.expl.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>16 August 2005<BR>


<P>Paragraph 17 of 14.7.3 [temp.expl.spec] says,</P>

<BLOCKQUOTE>

A member or a member template may be nested within many enclosing
class templates. In an explicit specialization for such a member, the
member declaration shall be preceded by a <TT>template&lt;&gt;</TT>
for each enclosing class template that is explicitly specialized.

</BLOCKQUOTE>

<P>This is curious, because paragraph 3 only allows explicit
specialization of members of implicitly-instantiated class
specializations, not explicit specializations.  Furthermore,
paragraph 4 says,</P>

<BLOCKQUOTE>

Definitions of members of an explicitly specialized class are defined
in the same manner as members of normal classes, and not using the
explicit specialization syntax.

</BLOCKQUOTE>

<P>Paragraph 18 provides a clue for resolving the apparent
contradiction:</P>

<BLOCKQUOTE>

In an explicit specialization declaration for a member of a class
template or a member template that appears in namespace scope, the
member template and some of its enclosing class templates may remain
unspecialized, except that the declaration shall not explicitly
specialize a class member template if its enclosing class templates
are not explicitly specialized as well. In such explicit
specialization declaration, the keyword <TT>template</TT> followed by
a <I>template-parameter-list</I> shall be provided instead of
the <TT>template&lt;&gt;</TT> preceding the explicit specialization
declaration of the member.

</BLOCKQUOTE>

<P>It appears from this and the following example that the phrase
&#8220;explicitly specialized&#8221; in paragraphs 17 and 18, when
referring to enclosing class templates, does not mean that explicit
specializations have been declared for them but that their names in
the <I>qualified-id</I> are followed by template argument lists.  This
terminology is confusing and should be changed.</P>

<P><B>Proposed resolution (October, 2005):</B></P>

<OL><LI><P>Change 14.7.3 [temp.expl.spec] paragraph 17 as
indicated:</P></LI>

<BLOCKQUOTE>

A member or a member template may be nested within many enclosing
class templates. In an explicit specialization for such a member, the
member declaration shall be preceded by a <TT>template&lt;&gt;</TT>
for each enclosing class template <SPAN style="text-decoration:line-through;background-color:#FFA0A0">that is explicitly specialized</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">specialization</SPAN>. [<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change 14.7.3 [temp.expl.spec] paragraph 18 as
indicated:</P></LI>

<BLOCKQUOTE>

In an explicit specialization declaration for a member of a class
template or a member template that appears in namespace scope, the
member template and some of its enclosing class templates may remain
unspecialized, <SPAN style="text-decoration:line-through;background-color:#FFA0A0">except that the declaration shall not explicitly
specialize a class member template if its enclosing class templates
are not explicitly specialized as well</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">that is, the
<I>template-id</I> naming the template may be composed of template
parameter names rather than <I>template-argument</I>s</SPAN>. <SPAN style="text-decoration:line-through;background-color:#FFA0A0">In</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">For each unspecialized template in</SPAN> such <SPAN style="font-weight:bold;background-color:#A0FFA0">an</SPAN> explicit
specialization declaration, the keyword <TT>template</TT> followed by
a <I>template-parameter-list</I> shall be provided instead of
the <TT>template&lt;&gt;</TT> preceding the <SPAN style="text-decoration:line-through;background-color:#FFA0A0">explicit
specialization</SPAN> declaration of the member. The types of
the <I>template-parameter</I>s in the <I>template-parameter-list</I>
shall be the same as those specified in the primary template
definition. <SPAN style="font-weight:bold;background-color:#A0FFA0">In such declarations, an unspecialized <I>template-id</I>
shall not precede the name of a template specialization in the
<I>qualified-id</I> naming the member.</SPAN> [<I>Example:</I>...

</BLOCKQUOTE>

</OL>

<P><B>Notes from the April, 2006 meeting:</B></P>

<P>The revised wording describing &#8220;unspecialized&#8221; templates
needs more work to ensure that the parameter names in the
<I>template-id</I> are in the correct order; the distinction between
template arguments and parameters is also probably not clear enough.  It
might be better to replace this paragraph completely and avoid the
&#8220;unspecialized&#8221; wording altogether.</P>

<P><B>Proposed resolution (February, 2010):</B></P>

<OL><LI><P>Change 14.7.3 [temp.expl.spec] paragraph 17 as follows:</P></LI>

<BLOCKQUOTE>

A member or a member template may be nested within many enclosing
class templates.  In an explicit specialization for such a
member, the member declaration shall be preceded by a
<TT>template&lt;&gt;</TT> for each enclosing class template
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">that is explicitly specialized</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">specialization</SPAN>. [<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change 14.7.3 [temp.expl.spec] paragraph 18 as follows:</P></LI>

<BLOCKQUOTE>

In an explicit specialization declaration for a member of a
class template or a member template that appears in namespace
scope, the member template and some of its enclosing class
templates may remain unspecialized, <SPAN style="text-decoration:line-through;background-color:#FFA0A0">except that the declaration
shall not explicitly specialize a class member template if its
enclosing class templates are not explicitly specialized as well.
In such explicit specialization declaration, the keyword
<TT>template</TT> followed by a <I>template-parameter-list</I>
shall be provided instead of the <TT>template&lt;&gt;</TT>
preceding the explicit specialization declaration of the member.
The types of the <I>template-parameter</I>s in the
<I>template-parameter-list</I> shall be the same as those
specified in the primary template definition.</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">that is,
the corresponding template prefix may specify a
<I>template-parameter-list</I> instead of <TT>template&lt;&gt;</TT>
and the <I>template-id</I> naming the template be written using
those <I>template-parameter</I>s as <I>template-argument</I>s.
In such a declaration, the number, kinds, and types of the
<I>template-parameter</I>s shall be the same as those specified in
the primary template definition, and the <I>template-parameter</I>s
shall be named in the <I>template-id</I> in the same order that they
appear in the <I>template-parameter-list</I>.  An unspecialized
<I>template-id</I> shall not precede the name of a template
specialization in the <I>qualified-id</I> naming the member.</SPAN>
[<I>Example:</I>...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="727"></A><H4>727.
  
In-class explicit specializations
</H4><B>Section: </B>14.7.3&#160; [temp.expl.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Faisal Vali
 &#160;&#160;&#160;

 <B>Date: </B>5 October, 2008<BR>


<P>14.7.3 [temp.expl.spec] paragraph 2 requires that explicit
specializations of member templates be declared in namespace scope, not
in the class definition.  This restriction does not apply to partial
specializations of member templates; that is,</P>

<PRE>
    struct A {
      template&lt;class T&gt; struct B;
      template &lt;class T&gt; struct B&lt;T*&gt; { }; //<SPAN style="font-family:Times;font-style:italic"> well-formed</SPAN>
      template &lt;&gt; struct B&lt;int*&gt; { }; //<SPAN style="font-family:Times;font-style:italic"> ill-formed</SPAN>
    };
</PRE>

<P>There does not seem to be a good reason for this inconsistency.</P>

<P><B>Additional note (October, 2013):</B></P>

<P>EWG has requested CWG to consider resolving this issue.  See EWG
issue 41.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>See also paper N4090.</P>

<BR><BR><HR><A NAME="1840"></A><H4>1840.
  
Non-deleted explicit specialization of deleted function template
</H4><B>Section: </B>14.7.3&#160; [temp.expl.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-19<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#941">issue 941</A> permits a
non-deleted explicit specialization of a deleted function template.
For example:</P>

<PRE>
  template&lt;typename T&gt; void f() = delete;
  decltype(f&lt;int&gt;()) *p;
  template&lt;&gt; void f&lt;int&gt;();
</PRE>

<P>However, the existing normative wording is not adequate to handle
this usage.  For one thing, <TT>=delete</TT> is formally, at least,
a function definition, and an implementation is not permitted to
instantiate a function definition unless it is used; presumably, then,
an implementation could not reject the <TT>decltype</TT> above as
a reference to a deleted specialization.  Furthermore, there should
be a requirement that a non-deleted explicit specialization of a
deleted function template must precede any reference to that
specialization.  (I.e., the example should be ill-formed as written
but well-formed if the last two lines were interchanged.)</P>

<BR><BR><HR><A NAME="1391"></A><H4>1391.
  
Conversions to parameter types with non-deduced template arguments
</H4><B>Section: </B>14.8.1&#160; [temp.arg.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2011-09-08<BR>




<P>According to 14.8.1 [temp.arg.explicit] paragraph 6,</P>

<BLOCKQUOTE>

Implicit conversions (Clause 4 [conv]) will be
performed on a function argument to convert it to the type of the
corresponding function parameter if the parameter type contains
no <I>template-parameter</I>s that participate in template argument
deduction.  [<I>Note:</I> Template parameters do not participate in
template argument deduction if they are explicitly specified...

</BLOCKQUOTE>

<P>But this isn't clear about when these conversions are done.
Consider</P>

<PRE>
    template&lt;class T&gt; struct A {
       typename T::N n;
    };
    template&lt;class T&gt; struct B { };

    template&lt;class T, class T2&gt;
    void foo(const A&lt;T&gt;&amp; r); // #1
    template&lt;class T&gt;
    void foo(const B&lt;T&gt;&amp; r); // #2

    void baz() {
       B&lt;char&gt; b;
       foo(b); // OK
       foo&lt;char&gt;(b); // error
    }
</PRE>

<P>With the explicit template argument, the first parameter of #1
no longer participates in template argument deduction, so
implicit conversions are done.  If we check for the implicit
conversion during the deduction process, we end up instantiating
<TT>A&lt;char&gt;</TT>, resulting in a hard error.  If we wait
until later to check the conversion, we can reject #1 because
<TT>T2</TT> is not deduced and never need to consider the
conversion.</P>

<P>But if we just accept the parameter and leave it up to normal
overload resolution to reject an unsuitable candidate, that
breaks this testcase:</P>

<PRE>
    template&lt;class T&gt;
    struct A {
       typename T::N n;
    };

    template&lt;class T&gt;
    struct B { };

    template &lt;class T, class... U&gt;
    typename A&lt;T&gt;::value_t bar(int, T, U...);

    template &lt;class T&gt;
    T bar(T, T);

    void baz()
    {
       B&lt;char&gt; b;
       bar(b, b);
    }
</PRE>

<P>Here, if deduction succeeds, we substitute in the deduced
arguments of <TT>T = B&lt;char&gt;, U = { }</TT>, and end up
instantiating <TT>A&lt;B&lt;char&gt;&gt;</TT>, which fails.</P>

<P>EDG and GCC currently reject the first testcase and accept the
second; clang accepts both.</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>The position initially favored by CWG was that implicit conversions
are not considered during deduction but are only applied afterwards,
so the second example is ill-formed, and that the normative wording of
the referenced paragraph should be moved into the note.  This approach
does not handle some examples currently accepted by some implementations,
however; for example:</P>

<PRE>
   template &lt;class T&gt; struct Z {
    typedef T::x xx;
   };
   template &lt;class T&gt; Z&lt;T&gt;::xx f(void *, T);
   template &lt;class T&gt; void f(int, T);
   struct A {} a;
   int main() {
     f(1, a); //<SPAN style="font-family:Times;font-style:italic"> If the implementation rules out the first overload</SPAN>
              //<SPAN style="font-family:Times;font-style:italic"> because of the invalid conversion from </SPAN>int<SPAN style="font-family:Times;font-style:italic"> to </SPAN>void*<SPAN style="font-family:Times;font-style:italic">,</SPAN>
              //<SPAN style="font-family:Times;font-style:italic"> the error instantiating </SPAN>Z&lt;A&gt;<SPAN style="font-family:Times;font-style:italic"> will be avoided</SPAN>
   }
</PRE>

<P>Additional discussion is required.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>The approach needed to accept this code appears to be doing the
convertibility check between deduction and substitution.</P>

<BR><BR><HR><A NAME="1172"></A><H4>1172.
  
&#8220;instantiation-dependent&#8221; constructs
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>2010-08-05<BR>


<P>There are certain constructs that are not covered by the existing
categories of &#8220;type dependent&#8221; and &#8220;value
dependent.&#8221;  For example, the expression
<TT>sizeof(sizeof(T()))</TT> is neither type-dependent nor
value-dependent, but its validity depends on whether <TT>T</TT>
can be value-constructed.  We should be able to overload on
such characteristics and select via deduction failure, but we
need a term like &#8220;instantiation-dependent&#8221; to
describe these cases in the Standard.  The phrase &#8220;expression
involving a template parameter&#8221; seems to come pretty close to
capturing this idea.</P>

<P><B>Notes from the November, 2010 meeting:</B></P>

<P>The CWG favored extending the concepts of &#8220;type-dependent&#8221;
and &#8220;value-dependent&#8221; to cover these additional cases,
rather than adding a new concept.</P>

<P><B>Notes from the March, 2011 meeting:</B></P>

<P>The CWG reconsidered the direction from the November, 2010 meeting,
as it would make more constructs dependent, thus requiring more
<TT>template</TT> and <TT>typename</TT> keywords, resulting in worse
error messages, etc.</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>The following example (from <A HREF="
     cwg_closed.html#1273">issue 1273</A>)
was deemed relevant for this issue:</P>

<PRE>
    template &lt;class T&gt; struct C;

    class A {
       int i;
       friend struct C&lt;int&gt;;
    } a;

    class B {
       int i;
       friend struct C&lt;float&gt;;
    } b;

    template &lt;class T&gt;
    struct C {
       template &lt;class U&gt; decltype (a.i) f() { } // #1
       template &lt;class U&gt; decltype (b.i) f() { } // #2
    };

    int main() {
       C&lt;int&gt;().f&lt;int&gt;();     // calls #1
       C&lt;float&gt;().f&lt;float&gt;(); // calls #2
    }
</PRE>



<BR><BR><HR><A NAME="1322"></A><H4>1322.
  
Function parameter type decay in templates
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2011-05-19<BR>




<P>The discussion of <A HREF="
     cwg_active.html#1001">issue 1001</A> seemed to have
settled on the approach of doing the 8.3.5 [dcl.fct]
transformations immediately to the function template declaration, so
that the original form need not be remembered.  However, the example
in 14.8.2 [temp.deduct] paragraph 8 suggests otherwise:</P>

<PRE>
  template &lt;class T&gt; int f(T[5]);
  int I = f&lt;int&gt;(0);
  int j = f&lt;void&gt;(0); //<SPAN style="font-family:Times;font-style:italic"> invalid array</SPAN>
</PRE>

<P>One way that might be addressed would be to separate the concepts
of the type of the template that participates in overload resolution and
function matching from the type of the template that is the source for
template argument substitution.  (See also the example in paragraph 3 of
the same section.)</P>

<P><B>Notes, January, 2012:</B></P>

<P></P>

<BR><BR><HR><A NAME="1724"></A><H4>1724.
  
Unclear rules for deduction failure
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-31<BR>




<P>According to 14.8.2 [temp.deduct] paragraph 8,</P>

<BLOCKQUOTE>

If a substitution results in an invalid type or expression, type deduction
fails. An invalid type or expression is one that would be ill-formed, with
a diagnostic required, if written using the substituted arguments.

</BLOCKQUOTE>

<P>Presumably the phrase &#8220;if written&#8221; refers to rewriting the
template declaration <I>in situ</I> with the substituted arguments, rather
than writing that type or expression at some arbitrary location, e.g.,</P>

<PRE>
  void g(double) = delete;

  template&lt;class T&gt; auto f(T t) -&gt; decltype(g(t));

  void g(int);

  void h() {
    typedef int T;
    T t = 42;
    g(t);  //<SPAN style="font-family:Times;font-style:italic"> Ok (I &#8220;wrote the substituted arguments&#8221;, and it seems fine)</SPAN>
    f(42); //<SPAN style="font-family:Times;font-style:italic"> Presumably substitution is meant to fail.</SPAN>
  }
</PRE>

<P>Perhaps a clearer formulation could be used?</P>

<BR><BR><HR><A NAME="1844"></A><H4>1844.
  
Defining &#8220;immediate context&#8221;
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-28<BR>




<P>The handling of an example like</P>

<PRE>
  template&lt;typename T, std::size_t S = sizeof(T)&gt; struct X {};
  template&lt;typename T&gt; X&lt;T&gt; foo(T*);
  void foo(...);

  void test() { struct S *s; foo(s); }
</PRE>

<P>varies among implementations, presumably because the meaning of
&#8220;immediate context&#8221; in determining whether an error is
a substitution failure or a hard error is not clearly defined.</P>

<BR><BR><HR><A NAME="1513"></A><H4>1513.
  
<TT>initializer_list</TT> deduction failure
</H4><B>Section: </B>14.8.2.1&#160; [temp.deduct.call]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>2012-06-28<BR>


<P>According to 14.8.2.1 [temp.deduct.call] paragraph 1,</P>

<BLOCKQUOTE>

If removing references and cv-qualifiers from <TT>P</TT> gives
<TT>std::initializer_list&lt;<I>P'</I>&gt;</TT> for some
<TT><I>P'</I></TT> and the argument is an initializer list
(8.5.4 [dcl.init.list]), then deduction is performed instead for
each element of the initializer list, taking <TT><I>P'</I></TT> as a
function template parameter type and the initializer element as its
argument. Otherwise, an initializer list argument causes the parameter
to be considered a non-deduced context (14.8.2.5 [temp.deduct.type]).

</BLOCKQUOTE>

<P>It is not entirely clear whether the deduction for an initializer
list meeting a <TT>std::initializer_list&lt;T&gt;</TT> is a recursive
subcase, or part of the primary deduction.  A relevant question is:
if the deduction on that part fails, does the entire deduction fail,
or is the parameter to be considered non-deduced?
</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>CWG determined that the entire deduction fails in this case.</P>

<BR><BR><HR><A NAME="1939"></A><H4>1939.
  
Argument conversions to nondeduced parameter types revisited
</H4><B>Section: </B>14.8.2.1&#160; [temp.deduct.call]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-11<BR>


<P>The intent of the resolution of <A HREF="
     cwg_defects.html#1184">issue 1184</A> appears not to have been completely realized.  In
particular, the phrase, &#8220;contains
no <I>template-parameter</I>s that participate in template
argument deduction&#8221; in both the note in
14.8.2.1 [temp.deduct.call] paragraph 4 and the normative
wording in 14.8.1 [temp.arg.explicit] paragraph 6 is potentially
misleading and probably should say something like,
&#8220;contains no <I>template-parameter</I>s outside non-deduced
contexts.&#8221; Also, the normative wording should be moved to
14.8.2.1 [temp.deduct.call] paragraph 4, since it applies when
there are no explicitly-specified template arguments.  For
example,</P>

<PRE>
  template&lt;typename T&gt;
  void f(T, typename identity&lt;T&gt;::type*);
</PRE>

<P>Presumably the second parameter should allow pointer conversions,
even though it does contain a <I>template-parameter</I> that
participates in deduction (via the first function parameter).</P>

<BR><BR><HR><A NAME="1486"></A><H4>1486.
  
Base-derived conversion in member pointer deduction
</H4><B>Section: </B>14.8.2.2&#160; [temp.deduct.funcaddr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2012-03-26<BR>


<P>The rules for deducing template arguments when taking the address of a
function template in 14.8.2.2 [temp.deduct.funcaddr] do not appear to allow
for a base-to-derived conversion in a case like:</P>

<PRE>
  struct Base {
    template&lt;class U&gt; void f(U);
  };

  struct Derived : Base { };

  int main() {
    void (Derived::*pmf)(int) = &amp;Derived::f;
  } 
</PRE>

<P>Most implementations appear to allow this adjustment, however.</P>

<BR><BR><HR><A NAME="1610"></A><H4>1610.
  
Cv-qualification in deduction of reference to array
</H4><B>Section: </B>14.8.2.4&#160; [temp.deduct.partial]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-01-28<BR>


<P>Given</P>

<PRE>
   template&lt;class C&gt; void foo(const C* val) {}
   template&lt;int N&gt; void foo(const char (&amp;t)[N]) {}
</PRE>

<P>it is intuitive that the second template is more specialized than
the first.  However, the current rules make them unordered.
In 14.8.2.4 [temp.deduct.partial] paragraph 4, we have P as
<TT>const C*</TT> and A as <TT>const char (&amp;)[N]</TT>.  Paragraph 5
transforms A to <TT>const char[N]</TT>.  Finally, paragraph 7 removes
top-level cv-qualification; since a cv-qualified array element type is
considered to be cv-qualification of the array (3.9.3 [basic.type.qualifier]
paragraph 5, cf <A HREF="
     cwg_defects.html#1059">issue 1059</A>), A
becomes <TT>char[N]</TT>.  P remains <TT>const C*</TT>, so deduction fails
because of the missing <TT>const</TT> in A.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>CWG agreed that the <TT>const</TT> should be preserved in the
array type.</P>

<BR><BR><HR><A NAME="1825"></A><H4>1825.
  
Partial ordering between variadic and non-variadic function templates
</H4><B>Section: </B>14.8.2.4&#160; [temp.deduct.partial]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-30<BR>




<P>Given the following example,</P>

<PRE>
  template &lt;class ...T&gt; int f(T*...)  { return 1; }
  template &lt;class T&gt;  int f(const T&amp;) { return 2; }
  void g() {
    f((int*)0);
  }
</PRE>

<P>the current specification makes the call ambiguous
because deduction fails in both directions: with A
being <TT>T</TT> and P being <TT>T*</TT> in one direction
and A being <TT>T*</TT> and P being <TT>T</TT>, because
14.8.2.4 [temp.deduct.partial] paragraph 8 says,</P>

<BLOCKQUOTE>

If A was transformed from a function parameter pack and P is
not a parameter pack, type deduction fails.

</BLOCKQUOTE>

<P>It is not clear whether this is the best outcome, however; it
might be better to consider the first template more specialized,
with the variadic/non-variadic test being a tie-breaker if there
is no other reason to prefer one over the other based on the
parameter types.</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG felt that the best approach would be, when comparing <TT>P</TT>
and <TT>A</TT>, if <TT>A</TT> is a pack and <TT>P</TT> is not, <TT>A</TT>
should be repeated for each remaining instance of <TT>P</TT> and then use
the variadic/nonvariadic criterion as a late tiebreaker if the result is
still ambiguous.  This would apply in the general case (including
14.8.2.4 [temp.deduct.partial]), not just in function calls.</P>

<BR><BR><HR><A NAME="1395"></A><H4>1395.
  
Partial ordering of variadic templates reconsidered
</H4><B>Section: </B>14.8.2.5&#160; [temp.deduct.type]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2011-09-21<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#692">issue 692</A> (found in
document N3281) made the following example ambiguous and thus
ill-formed:</P>

<PRE>
    template&lt;class T&gt;
    void print(ostream &amp;os, const T &amp;t) {
        os &lt;&lt; t;
    }

    template &lt;class T, class... Args&gt;
    void print(ostream &amp;os, const T &amp;t, const Args&amp;... rest) {
        os &lt;&lt; t &lt;&lt; ", ";
        print(os, rest...);
    }

    int main() {
        print(cout, 42);
        print(cout, 42, 1.23);
    }
</PRE>

<P>This pattern seems fairly intuitive; is it reason to reconsider or
modify the outcome of <A HREF="
     cwg_defects.html#692">issue 692</A>?</P>

<P>(See also <A HREF="
     cwg_active.html#1432">issue 1432</A>.)</P>

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>CWG agreed that the example should be accepted, handling this case
as a late tiebreaker, preferring an omitted parameter over a parameter
pack.</P>

<P><B>Additional note (March, 2013):</B></P>

<P>For another example:</P>

<PRE>
  template&lt;typename ...T&gt; int f(T*...) {
    return 1;
  }
  template&lt;typename T&gt; int f(const T&amp;) {
    return 2;
  }
  int main() {
    if (f((int*)0) != 1) {
       return 1;
    }
    return 0;
  }
</PRE>

<P>This worked as expected prior to the resolution of
<A HREF="
     cwg_defects.html#692">issue 692</A>.</P>

<BR><BR><HR><A NAME="1847"></A><H4>1847.
  
Clarifying compatibility during partial ordering
</H4><B>Section: </B>14.8.2.5&#160; [temp.deduct.type]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-30<BR>




<P>There is implementation divergence in the handling of an example
like</P>

<PRE>
  template&lt;typename D&gt; struct A { };
  template&lt;typename T&gt; struct Wrap1 { typedef T type; };
  template&lt;typename T&gt; struct Wrap2 { typedef T type; };

  template&lt;typename T1&gt;
  A&lt;typename Wrap1&lt;T1&gt;::type&gt;
  fn(const A&lt;T1&gt;&amp; x, const A&lt;T1&gt;&amp; y);

  template&lt;typename T2, typename U&gt;
  A&lt;typename Wrap2&lt;T2&gt;::type&gt;
  fn(const A&lt;T2&gt;&amp; x, const A&lt;U&gt;&amp; y);

  A&lt;int&gt; (*p)(const A&lt;int&gt;&amp;, const A&lt;int&gt;&amp;) = fn;
</PRE>

<P>The implementations that accept this example do so by not
comparing the return types of the two templates during
partial ordering, which seems to make sense given that partial
ordering would not have been performed if the candidate
specializations were not indistinguishable from the perspective of
overload resolution.  However, the existing wording is not clear
that that is how such types are be handled.</P>

<BR><BR><HR><A NAME="1863"></A><H4>1863.
  
Requirements on thrown object type to support <TT>std::current_exception()</TT>
</H4><B>Section: </B>15.1&#160; [except.throw]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Canada
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-22<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#CA12">N3690 comment
  CA&#160;12<BR></A>

<P>The specification of <TT>std::current_exception()</TT> in
18.8.5 [propagation] allows either referring to the exception object
itself or to a copy thereof, implying that the exception object must be
copyable.  However, the specification of <I>throw-expression</I> allows
throwing objects that cannot be copied, only moved.  Presumably the
requirements should include a non-deleted accessible copy constructor that
is odr-used by a <I>throw-expression</I>, even if the object being thrown
is moved to the exception object.</P>

<P><B>Additional note, February, 2014:</B></P>

<P>This issue was referred to CWG by EWG at the September, 2013 meeting
but was overlooked at that time.  </P>

<BR><BR><HR><A NAME="1975"></A><H4>1975.
  
Permissible declarations for <I>exception-specification</I>s
</H4><B>Section: </B>15.4&#160; [except.spec]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-18<BR>




<P>The declarations in which an <I>exception-specification</I> may
appear is not completely clear from the current wording of
15.4 [except.spec] paragraph 2.</P>

<P><U>Suggested resolution:</U></P>

<P>Change 15.4 [except.spec] paragraph 2 as follows:</P>

<BLOCKQUOTE>

An <I>exception-specification</I> shall appear only on a
function declarator for a function type, pointer to function
type, reference to function type, or pointer to member
function type that is the top-level type of a
declaration <SPAN style="text-decoration:line-through;background-color:#FFA0A0">or definition</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">of a function,
variable, or non-static data member</SPAN>, or on such a type
appearing as a parameter or return type in <SPAN style="font-weight:bold;background-color:#A0FFA0">such</SPAN> a
function declarator. <SPAN style="text-decoration:line-through;background-color:#FFA0A0">An <I>exception-specification</I> shall
not appear in a typedef declaration
or <I>alias-declaration</I>.</SPAN>  [<I>Example:</I>...

</BLOCKQUOTE>

<P>See also issues <A HREF="
     cwg_active.html#2010">2010</A>,
<A HREF="
     cwg_active.html#1995">1995</A>,
<A HREF="
     cwg_active.html#1946">1946</A>,
and <A HREF="
     cwg_closed.html#1798">1798</A>.</P>

<BR><BR><HR><A NAME="2001"></A><H4>2001.
  
<I>non-directive</I> is underspecified
</H4><B>Section: </B>16&#160; [cpp]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-10<BR>




<P>The Standard needs to describe <I>non-directive</I>s more fully,
e.g., whether they are ill-formed, conditionally-supported, etc.
Since they are, in fact, directives, a different name might also be
in order.</P>

<BR><BR><HR><A NAME="1436"></A><H4>1436.
  
Interaction of constant expression changes with preprocessor expressions
</H4><B>Section: </B>16.1&#160; [cpp.cond]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-01-02<BR>




<P>It appears that some of the recent changes to the description of
constant expressions have allowed constructs into preprocessor
expressions that do not belong there.  Some changes are required to
restrict the current capabilities of constant expressions to what
is intended to be allowed in preprocessor expressions.</P>

<P><B>Proposed resolution (February, 2012):</B></P>

<OL><LI><P>Change 16.1 [cpp.cond] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

Each preprocessing token that remains (in the list of preprocessing
tokens that will become the controlling expression) after all macro
replacements have occurred shall be in the lexical form of a token
(2.6 [lex.token]). <SPAN style="font-weight:bold;background-color:#A0FFA0">Any such token that is a literal
(2.13.1 [lex.literal.kinds]) shall be an <I>integer-literal</I>, a
<I>character-literal</I>, or a <I>boolean-literal</I>.</SPAN>

</BLOCKQUOTE>

<LI><P>Change 16.1 [cpp.cond] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

...using arithmetic that has at least the ranges specified in
18.3 [support.limits]. <SPAN style="font-weight:bold;background-color:#A0FFA0">The only operators permitted in the
controlling constant expression are <TT>?:</TT>, <TT>||</TT>,
<TT>&amp;&amp;</TT>, <TT>|</TT>, <TT>^</TT>, <TT>&amp;</TT>,
<TT>==</TT>, <TT>!=</TT>, <TT>&lt;</TT>, <TT>&lt;=</TT>,
<TT>&gt;</TT>, <TT>&gt;=</TT>, <TT>&lt;&lt;</TT>, <TT>&gt;&gt;</TT>,
<TT>-</TT>, <TT>+</TT>, <TT>*</TT>, <TT>/</TT>, <TT>%</TT>,
<TT>!</TT>, and <TT>~</TT>.</SPAN> For the purposes of this token
conversion...

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="1718"></A><H4>1718.
  
Macro invocation spanning end-of-file
</H4><B>Section: </B>16.3&#160; [cpp.replace]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-23<BR>


<P>Although it seems to be common implementation practice to reject
a macro invocation that begins in a header file and whose closing
right parenthesis appears in the file that included it, there does
not seem to be a prohibition of this case in the specification of
function-style macros.  Should this be accepted?</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>CWG agreed that macro invocations spanning file boundaries should be
prohibited.  Resolution of this issue should be coordinated with WG14.</P>

<BR><BR><HR><A NAME="2003"></A><H4>2003.
  
Zero-argument macros incorrectly specified
</H4><B>Section: </B>16.3&#160; [cpp.replace]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-12<BR>




<P>According to 16.3 [cpp.replace] paragraph 4,</P>

<BLOCKQUOTE>

If the <I>identifier-list</I> in the macro definition does not end
with an ellipsis, the number of arguments (including those
arguments consisting of no preprocessing tokens) in an
invocation of a function-like macro shall equal the number
of parameters in the macro definition.

</BLOCKQUOTE>

<P>That is, a sequence of no preprocessing tokens counts as an
argument.  That phrasing has problems with zero-argument
function-like macros, e.g.,</P>

<PRE>
  #define M()
  M();
</PRE>

<P><TT>M</TT> is defined as having no parameters but the invocation
has one (empty) argument, which does not match the number of
parameters in the definition.</P>

<BR><BR><HR><A NAME="1335"></A><H4>1335.
  
Stringizing, extended characters, and universal-character-names
</H4><B>Section: </B>16.3.2&#160; [cpp.stringize]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-07-03<BR>




<P>When a string literal containing an extended character is
stringized (16.3.2 [cpp.stringize]), the result contains a
universal-character-name instead of the original extended character.
The reason is that the extended character is translated to a
universal-character-name in translation phase 1 (2.2 [lex.phases]), so that the string literal <TT>"@"</TT> (where <TT>@</TT>
represents an extended character) becomes <TT>"\uXXXX"</TT>.  Because
the preprocessing token is a string literal, when the stringizing
occurs in translation phase 4, the <TT>\</TT> is doubled, and the
resulting string literal is <TT>"\"\\uXXXX\""</TT>.  As a result, the
universal-character-name is not recognized as such when the translation
to the execution character set occurs in translation phase 5.  (Note
that phase 5 translation does occur if the stringized extended character
does not appear in a string literal.)  Existing practice appears to
ignore these rules and preserve extended characters in stringized
string literals, however.</P>

<P>See also <A HREF="
     cwg_active.html#578">issue 578</A>.</P>

<P><B>Additional note (August, 2013):</B></P>

<P>Implementations are granted substantial latitude in their
handling of extended characters and universal-character-names in
2.2 [lex.phases] paragraph 1 phase 1, i.e.,</P>

<BLOCKQUOTE>

(An implementation may use any internal encoding, so long as an actual
extended character encountered in the source file, and the same extended
character expressed in the source file as a universal-character-name (i.e.,
using the <TT>\uXXXX</TT> notation), are handled equivalently except where
this replacement is reverted in a raw string literal.)

</BLOCKQUOTE>

<P>However, this freedom is mostly nullified by the requirements of
stringizing in 16.3.2 [cpp.stringize] paragraph 2:</P>

<BLOCKQUOTE>

If, in the replacement list, a parameter is immediately preceded by
a <TT>#</TT> preprocessing token, both are replaced by a single character
string literal preprocessing token that contains the spelling of the
preprocessing token sequence for the corresponding argument.

</BLOCKQUOTE>

<P>This means that, in order to handle a construct like</P>

<PRE>
  #define STRINGIZE_LITERAL( X ) # X
  #define STRINGIZE( X ) STRINGIZE_LITERAL( X )

  STRINGIZE( STRINGIZE( identifier_\u00fC\U000000Fc ) ) 
</PRE>

<P>an implementation must recall the original spelling, including
the form of UCN and the capitalization of any non-numeric hexadecimal
digits, rather than simply translating the characters into a convenient
internal representation.</P>

<P>To effect the freedom asserted in 2.2 [lex.phases], the
description of stringizing should make the spelling of a
universal-character-name implementation-defined.</P>

<BR><BR><HR><A NAME="1709"></A><H4>1709.
  
Stringizing raw string literals containing newline
</H4><B>Section: </B>16.3.2&#160; [cpp.stringize]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2013-07-01<BR>


<P>Stringizing a raw string literal containing a newline produces an
invalid (unterminated) string literal and hence results in undefined
behavior.  It should be specified that a newline in a string literal is
transformed to the two characters <TT>'\' 'n'</TT> in the resulting string
literal.</P>

<P>A slightly related case involves stringizing a bare backslash
character: because backslashes are only escaped within a string or
character literal, a stringized bare backslash becomes <TT>"\"</TT>,
which is invalid and hence results in undefined behavior.</P>

<BR><BR><HR><A NAME="1279"></A><H4>1279.
  
Additional differences between C++ 2003 and C++ 2011
</H4><B>Section: </B>C.2&#160; [diff.cpp03]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-27<BR>




<P>A number of differences between C++03 and C++11 were omitted from
C.2 [diff.cpp03]:</P>

<UL><LI><P>New keywords.  Although these are said in C.2.1 [diff.cpp03.lex] only to invalidate C++03 code, they can also change
the meaning, e.g., <TT>thread_local x(y)</TT>, which would declare
a variable <TT>thread_local</TT> initialized with <TT>y</TT> in
C++03 and a thread-local variable <TT>y</TT> in C++11.</P></LI>

<LI><P>New deduction rules.</P></LI>

<LI><P>Removal of the deprecated string literal conversion.</P></LI>

<LI><P>When a <TT>friend</TT> function defined in a class template
is actually defined (i.e., with each instantiation or only when
odr-used).</P></LI>

<LI><P>Removal of access declarations.</P></LI>

<LI><P>Use of the injected-class-name of a class template as a
template <I>template-argument</I>.</P></LI>

</UL>

<P><B>Additional note (January, 2012):</B></P>

<P>In addition to the items previously mentioned, access declarations
were removed from C++11 but are not mentioned in C.2 [diff.cpp03].</P>

<P><B>Proposed (partial) resolution (February, 2012):</B></P>

<P>Add the following as a new section in C.2 [diff.cpp03]:</P>

<BLOCKQUOTE>

<P><TABLE width="100%"><TR><TD><B>C.2.5 Clause 11 [class.access]: member access control</B></TD>
<TD align="right"><B>pdiff.cpp03.class.access</B></TD>

</TR>

</TABLE></P>

<P><B>Change:</B> Remove access declarations.</P>

<P><B>Rationale:</B> Removal of feature deprecated since C++ 1998.</P>

<P><B>Effect on original feature:</B> Valid C++ 2003 code that uses
access declarations is ill-formed in this International Standard.
Instead, <I>using-declaration</I>s (7.3.3 [namespace.udecl]) can
be used.</P>

</BLOCKQUOTE>

<BR><BR><HR><A NAME="2031"></A><H4>2031.
  
Missing incompatibility for <TT>&amp;&amp;</TT>
</H4><B>Section: </B>C.2.3&#160; [diff.cpp03.expr]
 &#160;&#160;&#160;

 <B>Status: </B>drafting
 &#160;&#160;&#160;

 <B>Submitter: </B>Melissa Mears
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-31<BR>


<P>The introduction of rvalue references in C++11 changed the
interpretation of some previously well-formed examples such as
the following:</P>

<PRE>
  struct Struct { template &lt;typename T&gt; operator T(); };
  bool example_1 = new int &amp;&amp; false;               //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
  bool example_2 = &amp;Struct::operator int &amp;&amp; false; //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
</PRE>

<P>Previously the <TT>&amp;&amp;</TT> was interpreted as an operator,
while it is now part of a <I>type-name</I>.  However, this change is
not mentioned in Annex C [diff].</P>

<BR><BR><BR><BR><HR><A NAME="Open Status"></A><H3>Issues with "Open" Status</H3>
<HR><A NAME="916"></A><H4>916.
  
Does a reference type have a destructor?
</H4><B>Section: </B>_N2914_.14.10.2.1&#160; [concept.map.fct]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>12 June, 2009<BR>




<P>Is the following well-formed?</P>

<PRE>
    auto concept HasDestructor&lt;typename T&gt; {
      T::~T();
    }

    concept_map HasDestructor&lt;int&amp;&gt; { }
</PRE>

<P>According to _N2914_.14.10.2.1 [concept.map.fct] paragraph 4, the
destructor requirement in the concept map results in an expression
<TT>x.~X()</TT>, where <TT>X</TT> is the type <TT>int&amp;</TT>.
According to 5.2.4 [expr.pseudo], this expression is ill-formed
because the object type and the <I>type-name</I> must be the same type,
but the object type cannot be a reference type (references are dropped
from types used in expressions, 5 [expr] paragraph 5).</P>

<P>It is not clear whether this should be addressed by changing
5.2.4 [expr.pseudo] or _N2914_.14.10.2.1 [concept.map.fct].</P>

<BR><BR><HR><A NAME="783"></A><H4>783.
  
Definition of &#8220;argument&#8221;
</H4><B>Section: </B>1.3&#160; [intro.defs]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>UK
 &#160;&#160;&#160;

 <B>Date: </B>3 March, 2009<BR><BR>


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

<P>The definition of an argument does not seem to cover 
many assumed use cases, and we believe that is not 
intentional. There should be answers to
questions such as: Are lambda-captures 
arguments? Are type names in a throw-spec 
arguments? &#8220;Argument&#8221; to casts, typeid, alignof, 
alignas, decltype and sizeof? why in x[arg] arg is 
not an argument, but the value forwarded to 
operator[]() is? Does not apply to operators as 
call-points not bounded by parentheses? Similar 
for copy initialization and conversion? What are 
deduced template &#8220;arguments?&#8221; what are &#8220;default 
arguments?&#8221; can attributes have arguments? What 
about concepts, requires clauses and 
concept_map instantiations? What about user-defined
literals where parens are not used?</P>

<BR><BR><HR><A NAME="949"></A><H4>949.
  
Requirements for freestanding implementations
</H4><B>Section: </B>1.4&#160; [intro.compliance]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Detlef Vollman
 &#160;&#160;&#160;

 <B>Date: </B>2 August, 2009<BR>




<P>According to 1.4 [intro.compliance] paragraph 7,</P>

<BLOCKQUOTE>

A freestanding implementation is one in which execution may take place
without the benefit of an operating system, and has an
implementation-defined set of libraries that includes certain
language-support libraries (17.6.1.3 [compliance]).

</BLOCKQUOTE>

<P>This definition links two relatively separate topics: the lack
of an operating system and the minimal set of libraries.
Furthermore, 3.6.1 [basic.start.main] paragraph 1 says:</P>

<BLOCKQUOTE>

[<I>Note:</I> in a freestanding environment, start-up and termination
is implementation-defined; start-up contains the execution of
constructors for objects of namespace scope with static storage
duration; termination contains the execution of destructors for
objects with static storage duration. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<P>It would be helpful if the two characteristics (lack of an
operating system and restricted set of libraries) were named
separately and if these statements were clarified to identify exactly
what is implementation-defined.</P>

<P><B>Notes from the October, 2009 meeting:</B></P>

<P>The CWG felt that it needed a specific proposal in a paper before
attempting to resolve this issue.</P>

<BR><BR><HR><A NAME="1953"></A><H4>1953.
  
Data races and common initial sequence
</H4><B>Section: </B>1.7&#160; [intro.memory]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Faisal Vali
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-23<BR>




<P>According to 1.7 [intro.memory] paragraph 3,</P>

<BLOCKQUOTE>

A <I>memory location</I> is either an object of scalar type or a
maximal sequence of adjacent bit-fields all having non-zero
width. [<I>Note:</I> Various features of the language, such
as references and virtual functions, might involve
additional memory locations that are not accessible to
programs but are managed by the
implementation. &#8212;<I>end note</I>] Two or more threads
of execution (1.10 [intro.multithread]) can update and
access separate memory locations without interfering with
each other.

</BLOCKQUOTE>

<P>It is not clear how this relates to the permission
granted in 9.2 [class.mem] paragraph 18 to inspect
the common initial sequence of standard-layout structs that
are members of a standard-layout union.  If one thread is
writing to the common initial sequence and another is
reading from it via a different struct, that should
constitute a data race, but the current wording does not
clearly state that.</P>

<BR><BR><HR><A NAME="698"></A><H4>698.
  
The definition of &#8220;sequenced before&#8221; is too narrow
</H4><B>Section: </B>1.9&#160; [intro.execution]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jens Maurer
 &#160;&#160;&#160;

 <B>Date: </B>13 July, 2008<BR>




<P>According to 1.9 [intro.execution] paragraph 14, &#8220;sequenced
before&#8221; is a relation between &#8220;evaluations.&#8221;  However,
3.6.3 [basic.start.term] paragraph 3 says,</P>

<BLOCKQUOTE>

If the completion of the initialization of a non-local object with
static storage duration is sequenced before a call to
<TT>std::atexit</TT> (see <TT>&lt;cstdlib&gt;</TT>, 18.5 [support.start.term]), the call to the function passed to <TT>std::atexit</TT>
is sequenced before the call to the destructor for the object. If a
call to <TT>std::atexit</TT> is sequenced before the completion of the
initialization of a non-local object with static storage duration, the
call to the destructor for the object is sequenced before the call to
the function passed to <TT>std::atexit</TT>. If a call to
<TT>std::atexit</TT> is sequenced before another call to
<TT>std::atexit</TT>, the call to the function passed to the second
<TT>std::atexit</TT> call is sequenced before the call to the function
passed to the first <TT>std::atexit</TT> call.

</BLOCKQUOTE>

<P>Except for the calls to <TT>std::atexit</TT>, these events do not
correspond to &#8220;evaluation&#8221; of expressions that appear in
the program.  If the &#8220;sequenced before&#8221; relation is to be
applied to them, a more comprehensive definition is needed.</P>

<BR><BR><HR><A NAME="578"></A><H4>578.
  
Phase 1 replacement of characters with <I>universal-character-name</I>s
</H4><B>Section: </B>2.2&#160; [lex.phases]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Martin Vejn&#225;r
 &#160;&#160;&#160;

 <B>Date: </B>7 May 2006<BR>


<P>According to 2.2 [lex.phases] paragraph 1, in translation
phase 1,</P>

<BLOCKQUOTE>

Any source file character not in the basic source character set
(2.3 [lex.charset]) is replaced by the
universal-character-name that designates that character.

</BLOCKQUOTE>

<P>If a character that is not in the basic character set is preceded
by a backslash character, for example</P>

<PRE>
    "\&#225;"
</PRE>

<P>the result is equivalent to</P>

<PRE>
    "\\u00e1"
</PRE>

<P>that is, a backslash character followed by the spelling of the
universal-character-name.  This is different from the result in C99,
which accepts characters from the extended source character set without
replacing them with universal-character-names.</P>

<P>See also <A HREF="
     cwg_active.html#1335">issue 1335</A>.</P>

<BR><BR><HR><A NAME="1698"></A><H4>1698.
  
Files ending in <TT>\</TT>
</H4><B>Section: </B>2.2&#160; [lex.phases]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2013-06-10<BR>


<P>The description of how to handle file not ending in a newline in
2.2 [lex.phases] paragraph 1, phase 2, is:</P>

<OL START="2"><LI><P>Each instance of a backslash character (<TT>\</TT>)
immediately followed by a new-line character is deleted, splicing physical
source lines to form logical source lines. Only the last backslash on any
physical source line shall be eligible for being part of such a splice. If,
as a result, a character sequence that matches the syntax of a
universal-character-name is produced, the behavior is undefined. A source
file that is not empty and that does not end in a new-line character, or
that ends in a new-line character immediately preceded by a backslash
character before any such splicing takes place, shall be processed as if an
additional new-line character were appended to the file.</P></LI>

</OL>

<P>This is not clear regarding what happens if the last character in the
file is a backslash.  In such a case, presumably the result of adding the
newline should not be a line splice but rather a
backslash <I>preprocessing-token</I> (that will be diagnosed as an invalid
token in phase 7), but that should be spelled out.</P>

<BR><BR><HR><A NAME="1403"></A><H4>1403.
  
Universal-character-names in comments
</H4><B>Section: </B>2.7&#160; [lex.comment]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>David Krauss
 &#160;&#160;&#160;

 <B>Date: </B>2011-10-05<BR>


<P>According to 2.3 [lex.charset] paragraph 2,</P>

<BLOCKQUOTE>

If the hexadecimal value for a universal-character-name
corresponds to a surrogate code point (in the range
0xD800-0xDFFF, inclusive), the program is
ill-formed. Additionally, if the hexadecimal value for a
universal-character-name outside the <I>c-char-sequence</I>,
<I>s-char-sequence</I>, or <I>r-char-sequence</I> of a character
or string literal corresponds to a control character (in either
of the ranges 0x00-0x1F or 0x7F-0x9F, both inclusive) or to a
character in the basic source character set, the program is
ill-formed.

</BLOCKQUOTE>

<P>These restrictions should not apply to comment text.  Arguably
the prohibitions of control characters and characters in the basic
character set already do not apply, as they require that the
preprocessing tokens for literals have already been recognized; this
occurs in phase 3, which also replaces comments with single spaces.
However, the prohibition of surrogate code points is not so limited
and might conceivably be applied within comments.</P>

<P>Probably the most straightforward way of addressing this problem
would be simply to state in 2.7 [lex.comment] that
character sequences that resemble universal-character-names are not
recognized as such within comment text.</P>

<BR><BR><HR><A NAME="1972"></A><H4>1972.
  
Identifier character restrictions in non-<I>identifier</I>s
</H4><B>Section: </B>2.10&#160; [lex.name]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-15<BR>




<P>According to 2.10 [lex.name] paragraph 1,</P>

<BLOCKQUOTE>

Each universal-character-name in an identifier shall
designate a character whose encoding in ISO 10646 falls into
one of the ranges specified in <sect_ref ref="E.1">E.1 [charname.allowed]</sect_ref>.

</BLOCKQUOTE>

<P>However, <I>identifier-nondigit</I> is also used in the
grammar for <I>pp-number</I>.  Should this restriction also be
understood to apply in that non-identifier context?</P>

<BR><BR><HR><A NAME="411"></A><H4>411.
  
Use of universal-character-name in character versus string literals
</H4><B>Section: </B>2.13.5&#160; [lex.string]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Kanze
 &#160;&#160;&#160;

 <B>Date: </B>23 Apr 2003<BR>


<P>2.13.5 [lex.string] paragraph 5 reads</P>
<BLOCKQUOTE>
Escape sequences and
universal-character-names in string literals have the same meaning as in
character literals, except that the single quote ' is representable
either by itself or by the escape sequence \', and the double quote "
shall be preceded by a \. In a narrow string literal, a
universal-character-name may map to more than one char element due to
multibyte encoding.
</BLOCKQUOTE>

<P>The first sentence refers us to 2.13.3 [lex.ccon],
where we read in the
first paragraph that "An ordinary character literal that contains a
single c-char has type char [...]."  Since the grammar shows that a
universal-character-name is a c-char, something like '\u1234' must have
type char (and thus be a single char element); in paragraph 5, we read
that "A universal-character-name is translated to the encoding, in the
execution character set, of the character named.  If there is no such
encoding, the universal-character-name is translated to an
implemenation-defined encoding."</P>

<P>This is in obvious contradiction with the second sentence.  In addition,
I'm not really clear what is supposed to happen in the case where the
execution (narrow-)character set is UTF-8.  Consider the character
\u0153 (the oe in the French word oeuvre).  Should '\u0153' be a char,
with an "error" value, say '?' (in conformance with the requirement that
it be a single char), or an int, with the two char values 0xC5, 0x93, in
an implementation defined order (in conformance with the requirement
that a character representable in the execution character set be
represented).  Supposing the former, should "\u0153" be the equivalent of
"?" (in conformance with the first sentence), or "\xC5\x93" (in
conformance with the second).</P>

<P><B>Notes from October 2003 meeting:</B></P>

<P>We decided we should forward this to the C committee and let them
resolve it.  Sent via e-mail to John Benito on November 14, 2003.</P>

<P><B>Reply from John Benito:</B></P>
<BLOCKQUOTE>
<P>I talked this over with the C project editor, we believe this was
handled by the C committee before publication of the current standard.</P>

<P>WG14 decided there needed to be a more restrictive rule 
for one-to-one mappings: rather than saying "a single c-char" 
as C++ does, the C standard says "a single character that
maps to a single-byte execution character"; WG14 fully expect
some (if not many or even most) UCNs to map to multiple characters.</P>

<P>Because of the fundamental differences between C and C++ character
types, I am not sure the C committee is qualified to answer this
satisfactorily for WG21.  WG14 is willing to review any decision reached
for compatibility.</P>

<P>I hope this helps.</P>
</BLOCKQUOTE>

<P>(See also <A HREF="
     cwg_defects.html#912">issue 912</A> for a related
question.)</P>

<BR><BR><HR><A NAME="1266"></A><H4>1266.
  
<I>user-defined-integer-literal</I> overflow
</H4><B>Section: </B>2.13.8&#160; [lex.ext]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-20<BR>


<P>The <I>decimal-literal</I> in a <I>user-defined-integer-literal</I>
might be too large for an <TT>unsigned long long</TT> to represent (in
implementations with extended integer types).  In such cases, the
original intent appears to have been to call a raw literal operator or
a literal operator template; however, the existing wording of
2.13.8 [lex.ext] paragraph 3 always calls the
<TT>unsigned long long</TT> literal operator if it exists, regardless
of the value of the <I>decimal-literal</I>.</P>

<BR><BR><HR><A NAME="1209"></A><H4>1209.
  
Is a potentially-evaluated expression in a template definition a &#8220;use?&#8221;
</H4><B>Section: </B>3.2&#160; [basic.def.odr]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2010-10-08<BR>




<P>Consider the following complete program:</P>

<PRE>
    void f();
    template&lt;typename T&gt; void g() { f(); }
    int main() { }
</PRE>

<P>Must <TT>f()</TT> be defined to make this program well-formed?  The
current wording of 3.2 [basic.def.odr] does not make any special
provision for expressions that appear only in uninstantiated template
definitions.</P>

(See also <A HREF="
     cwg_closed.html#1254">issue 1254</A>.)

<BR><BR><HR><A NAME="2009"></A><H4>2009.
  
Unclear specification of class scope
</H4><B>Section: </B>3.3.7&#160; [basic.scope.class]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-23<BR>




<P>Point 2 of the rules of class scope in 3.3.7 [basic.scope.class]
paragraph 1 says,</P>

<BLOCKQUOTE>

A name <TT>N</TT> used in a class <TT>S</TT> shall refer to
the same declaration in its context and when re-evaluated in
the completed scope of <TT>S</TT>. No diagnostic is required
for a violation of this rule.

</BLOCKQUOTE>

<P>It is not clear that this provision does not apply to
names appearing in function bodies, default arguments,
<I>exception-specification</I>s, and
<I>brace-or-equal-initializer</I>s.  It is also not clear
what it means to &#8220;re-evaluate&#8221; a name.</P>

<P>One possible approach to this problem would be to say
that all names declared in a class are visible throughout
the class and simply make it ill-formed to refer to a
name that has not been declared yet in the contexts in
which that is problematic, such as types and template
arguments.</P>

<P>In addition, the fourth point says,</P>

<BLOCKQUOTE>

A name declared within a member function hides a declaration
of the same name whose scope extends to or past the end of
the member function's class.

</BLOCKQUOTE>

<P>This rule is unneeded, as it simply restates the normal
hiding rule in 3.3.1 [basic.scope.declarative] paragraph 1:</P>

<BLOCKQUOTE>

The scope of a declaration is the same as its potential
scope unless the potential scope contains another
declaration of the same name. In that case, the potential
scope of the declaration in the inner (contained)
declarative region is excluded from the scope of the
declaration

</BLOCKQUOTE>

<BR><BR><HR><A NAME="191"></A><H4>191.
  
Name lookup does not handle complex nesting
</H4><B>Section: </B>3.4.1&#160; [basic.lookup.unqual]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Alan Nash
 &#160;&#160;&#160;

 <B>Date: </B>29 Dec 1999<BR>





<P>The current description of unqualified name lookup in
3.4.1 [basic.lookup.unqual]
 paragraph 8 does
not correctly handle complex cases of nesting.  The Standard
currently reads,</P>

<BLOCKQUOTE>
A name used in the definition of a function that is a member function
(9.3) of a class <TT>X</TT> shall be declared in one of the following
ways:

<BR><UL>
<LI>before its use in the block in which it is used or in an enclosing
block (6.3), or</LI>

<LI>shall be a member of class <TT>X</TT> or be a member of a base
class of <TT>X</TT> (10.2), or</LI>

<LI>if <TT>X</TT> is a nested class of class <TT>Y</TT> (9.7), shall
be a member of <TT>Y</TT>, or shall be a member of a base class of
<TT>Y</TT> (this lookup applies in turn to <TT>Y</TT>'s enclosing
classes, starting with the innermost enclosing class), or</LI>

<LI>if <TT>X</TT> is a local class (9.8) or is a nested class of a
local class, before the definition of class <TT>X</TT> in a block
enclosing the definition of class <TT>X</TT>, or</LI>

<LI>if <TT>X</TT> is a member of namespace <TT>N</TT>, or is a nested
class of a class that is a member of <TT>N</TT>, or is a local class
or nested class within a local class of a function that is a member of
<TT>N</TT>, before the member function definition, in namespace
<TT>N</TT> or in one of <TT>N</TT>'s enclosing namespaces.</LI>
</UL>
</BLOCKQUOTE>

In particular, this formulation does not handle the following example:

<PRE>
    struct outer {
        static int i;
        struct inner {
            void f() {
                struct local {
                    void g() {
                        i = 5;
                    }
                };
            }
        };
    };
</PRE>

Here the reference to <TT>i</TT> is from a member function of a local
class of a member function of a nested class.  Nothing in the rules
allows <TT>outer::i</TT> to be found, although intuitively it should
be found.

<P>A more comprehensive formulation is needed that allows traversal of
any combination of blocks, local classes, and nested classes.
Similarly, the final bullet needs to be augmented so that a function
need not be a (direct) member of a namespace to allow searching that
namespace when the reference is from a member function of a class
local to that function.  That is, the current rules do not allow the
following example:</P>

<PRE>
    int j;    // global namespace
    struct S {
        void f() {
            struct local2 {
                void g() {
                    j = 5;
                }
            };
        }
    };
</PRE>
<BR><BR><HR><A NAME="405"></A><H4>405.
  
Unqualified function name lookup
</H4><B>Section: </B>3.4.1&#160; [basic.lookup.unqual]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>William M. Miller
 &#160;&#160;&#160;

 <B>Date: </B>14 Apr 2003<BR>


<P>There seems to be some confusion in the Standard regarding the
relationship between 3.4.1 [basic.lookup.unqual] (Unqualified name
lookup) and 3.4.2 [basic.lookup.argdep]
(Argument-dependent lookup).  For example,
3.4.1 [basic.lookup.unqual] paragraph 3 says,</P>

<BLOCKQUOTE>
The lookup for an unqualified name used as the
<I>postfix-expression</I> of a function call is described in
3.4.2 [basic.lookup.argdep].
</BLOCKQUOTE>

<P>In other words, nothing in 3.4.1 [basic.lookup.unqual]
applies to function names; the entire lookup is described in
3.4.2 [basic.lookup.argdep].</P>

<P>3.4.2 [basic.lookup.argdep] does not appear to share this
view of its responsibility.
The closest it comes is in 3.4.2 [basic.lookup.argdep] paragraph 2a:</P>

<BLOCKQUOTE>
...the set of declarations found by the lookup of the function
name is the union of the set of declarations found using ordinary
unqualified lookup and the set of declarations found in the namespaces
and classes associated with the argument types.
</BLOCKQUOTE>

<P>Presumably, "ordinary unqualified lookup" is a reference
to the processing described in
3.4.1 [basic.lookup.unqual], but, as noted above,
3.4.1 [basic.lookup.unqual]
explicitly precludes applying that processing to function names.  The
details of "ordinary unqualified lookup" of function names
are not described anywhere.</P>

<P>The other clauses that reference
3.4.2 [basic.lookup.argdep], clauses
13 [over] and 14 [temp], are
split over the question of the relationship between
3.4.1 [basic.lookup.unqual] and 3.4.2 [basic.lookup.argdep].
13.3.1.1.1 [over.call.func] paragraph 3, for instance, says</P>

<BLOCKQUOTE>
The name is looked up in the context of the function call
following the normal rules for name lookup in function calls
(3.4.2 [basic.lookup.argdep]).
</BLOCKQUOTE>

<P>I.e., this reference assumes that
3.4.2 [basic.lookup.argdep] is self-contained.  The
same is true of 13.3.1.2 [over.match.oper] paragraph 3,
second bullet:</P>

<BLOCKQUOTE>
The set of non-member candidates is the result of the
unqualified lookup of operator@ in the context of the expression
according to the usual rules for name lookup in unqualified function
calls (3.4.2 [basic.lookup.argdep]), except that all member
functions are ignored.
</BLOCKQUOTE>

<P>On the other hand, however, 14.6.4.2 [temp.dep.candidate]
paragraph 1 explicitly assumes that
3.4.1 [basic.lookup.unqual] and 3.4.2 [basic.lookup.argdep] are
both involved in function name lookup and do different things:</P>

<BLOCKQUOTE>
For a function call that depends on a template parameter, if
the function name is an <I>unqualified-id</I> but not a
<I>template-id</I>, the candidate functions are found using the usual
lookup rules (3.4.1 [basic.lookup.unqual],
3.4.2 [basic.lookup.argdep]) except that:
<UL>
<LI>For the part of the lookup using unqualified name lookup
(3.4.1 [basic.lookup.unqual]),
only function declarations with external linkage from the template
definition context are found.</LI>

<LI>For the part of the lookup using associated
namespaces (3.4.2 [basic.lookup.argdep]),
only function declarations with external linkage found in either the
template definition context or the template instantiation context are
found.</LI>
</UL>
</BLOCKQUOTE>

<B><P>Suggested resolution:</P></B>

<P>Change 3.4.1 [basic.lookup.unqual] paragraph 1 from</P>

<BLOCKQUOTE>
...name lookup ends as soon as a declaration is found for the
name.
</BLOCKQUOTE>

<P>to</P>

<BLOCKQUOTE>
...name lookup ends with the first scope containing one or more
declarations of the name.
</BLOCKQUOTE>

<P>Change the first sentence of 3.4.1 [basic.lookup.unqual]
paragraph 3 from</P>

<BLOCKQUOTE>
The lookup for an unqualified name used as the
<I>postfix-expression</I> of a function call is described in
3.4.2 [basic.lookup.argdep].
</BLOCKQUOTE>

<P>to</P>

<BLOCKQUOTE>
An unqualified name used as the <I>postfix-expression</I> of a
function call is looked up as described below.  In addition,
argument-dependent lookup (3.4.2 [basic.lookup.argdep]) is
performed on this name to
complete the resulting set of declarations.
</BLOCKQUOTE>



<BR><BR><HR><A NAME="1200"></A><H4>1200.
  
Lookup rules for template parameters
</H4><B>Section: </B>3.4.1&#160; [basic.lookup.unqual]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2010-09-18<BR>


<P>Although 3.3.9 [basic.scope.temp] now describes the scope of a
template parameter, the description of unqualified name lookup in
3.4.1 [basic.lookup.unqual] do not cover uses of template parameter
names.  The note in 3.4.1 [basic.lookup.unqual] paragraph 16 says,</P>

<BLOCKQUOTE>

the rules for name lookup in template definitions are described in
14.6 [temp.res].

</BLOCKQUOTE>

<P>but the rules there cover dependent and non-dependent names, not
template parameters themselves.</P>

<BR><BR><HR><A NAME="1771"></A><H4>1771.
  
Restricted lookup in <I>nested-name-specifier</I>
</H4><B>Section: </B>3.4.3&#160; [basic.lookup.qual]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Canada
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-24<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#CA21">N3690 comment
  CA&#160;21<BR></A>

<P>Consider the following example:</P>

<PRE>
  template &lt;typename T&gt; struct B { }; 
  namespace N { 
    namespace L { 
      template &lt;int&gt; void A(); 
    } 
    namespace M { 
      template &lt;int&gt; struct A { typedef int y; }; 
    } 
    using namespace L; 
    using namespace M; 
  } 
  B&lt;N::/*template */A&lt;0&gt;::y&gt; (x);
</PRE>

<P>Which <TT>A</TT> is referenced in the last line?  According to
3.4.3 [basic.lookup.qual] paragraph 1,</P>

<BLOCKQUOTE>

If a <TT>::</TT> scope resolution operator in
a <I>nested-name-specifier</I> is not preceded by
a <I>decltype-specifier</I>, lookup of the name preceding that
<TT>::</TT> considers only namespaces, types, and templates whose
specializations are types.

</BLOCKQUOTE>

<P>It is not clear whether this applies to the example or not,
and the interpretation of the <TT>&lt;</TT> token depends on the
result of the lookup.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>The restricted lookup mentioned in 3.4.3 [basic.lookup.qual]
paragraph 1 is based on a one-token lookahead; because the next
token following <TT>A</TT> in the example is not <TT>::</TT>,
the restricted lookup does not apply, and the result is ambiguous.
Uncommenting the <TT>template</TT> keyword in the example does not
affect the lookup.</P>

<BR><BR><HR><A NAME="562"></A><H4>562.
  
<I>qualified-id</I>s in non-expression contexts
</H4><B>Section: </B>3.4.3.1&#160; [class.qual]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>6 April 2006<BR>


<P>Both 3.4.3.1 [class.qual] and 3.4.3.2 [namespace.qual]
specify that some lookups are to be performed &#8220;in the context of the
entire <I>postfix-expression</I>,&#8221; ignoring the fact that
<I>qualified-id</I>s can appear outside of expressions.</P>

<P>It was suggested in document J16/05-0156 = WG21 N1896 that these
uses be changed to &#8220;the context in which the <I>qualified-id</I>
occurs,&#8221; but it isn't clear that this formulation adequately
covers all the places a <I>qualified-id</I> can occur.</P>

<BR><BR><HR><A NAME="278"></A><H4>278.
  
External linkage and nameless entities
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>12 Apr 2000<BR>




<P>It is unclear to what extent entities without names match
across translation units.  For example,</P>

<PRE>
    struct S {
       int :2;
       enum { a, b, c } x;
       static class {} *p;
    };
</PRE>

<P>If this declaration appears in multiple translation units, are
all these members "the same" in each declaration?</P>

<P>A similar question can be asked about non-member declarations:</P>

<PRE>
    // Translation unit 1:
    extern enum { d, e, f } y;

    // Translation unit 2:
    extern enum { d, e, f } y;

    // Translation unit 3:
    enum { d, e, f } y;
</PRE>

<P>Is this valid C++?  Is it valid C?</P>

<P><U>James Kanze</U>: <TT>S::p</TT> cannot be defined, because to
do so requires a type specifier and the type cannot be named.
<TT>::y</TT> is valid C because C only requires compatible, not
identical, types.  In C++, it appears that there is a new type in
each declaration, so it would not be valid.  This differs from
<TT>S::x</TT> because the unnamed type is part of a named type
&#8212; but I don't know where or if the Standard says that.</P>

<P><U>John Max Skaller</U>:
It's not valid C++, because the type is a synthesised, unique name
for the enumeration type which differs across translation units, as if:</P>

<PRE>
    extern enum _synth1 { d,e,f} y;
    ..
    extern enum _synth2 { d,e,f} y;
</PRE>

<P>had been written.</P>

<P>However, within a class, the ODR implies the types are the same:</P>

<PRE>
    class X { enum { d } y; };
</PRE>

<P>in two translation units ensures that the type of member <TT>y</TT>
is the same: the two <TT>X</TT>'s obey the ODR and so denote the same class,
and it follows that there's only one member <TT>y</TT> and one type that it
has.</P>

<P>(See also issues <A HREF="
     cwg_closed.html#132">132</A> and
<A HREF="
     cwg_defects.html#216">216</A>.)</P>

<BR><BR><HR><A NAME="279"></A><H4>279.
  
Correspondence of "names for linkage purposes"
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>4 Apr 2001<BR>




<P>The standard says that an unnamed class or enum definition can be given
a "name for linkage purposes" through a typedef.  E.g.,</P>

<PRE>
    typedef enum {} E;
    extern E *p;
</PRE>

<P>can appear in multiple translation units.</P>

<P>How about the following combination?</P>

<PRE>
    // Translation unit 1:
    struct S;
    extern S *q;

    // Translation unit 2:
    typedef struct {} S;
    extern S *q;
</PRE>

<P>Is this valid C++?</P>

<P>Also, if the answer is "yes", consider the following slight variant:</P>

<PRE>
    // Translation unit 1:
    struct S {};  // &lt;&lt;-- class has definition
    extern S *q;

    // Translation unit 2:
    typedef struct {} S;
    extern S *q;
</PRE>

<P>Is this a violation of the ODR because two definitions
of type <TT>S</TT> consist of differing token sequences?</P>

<BR><BR><HR><A NAME="338"></A><H4>338.
  
Enumerator name with linkage used as class name in other translation unit
</H4><B>Section: </B>3.5&#160; [basic.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>26 Feb 2002<BR>




<P>The following declarations are allowed within a translation
unit:</P>
<PRE>
  struct S;
  enum { S };
</PRE>
<P>However, 3.5 [basic.link] paragraph 9 seems to say
these two declarations
cannot appear in two different translation units.  That also
would mean that the inclusion of a header containing the above
in two different translation units is not valid C++.</P>

<P>I suspect this is an oversight and that users should be allowed
to have the declarations above appear in different translation
units.  (It is a fairly common thing to do, I think.)</P>

<P><U>Mike Miller</U>:
I think you meant "<TT>enum E { S };</TT>" -- enumerators only have
external linkage if the enumeration does (3.5 [basic.link]
paragraph 4), and 3.5 [basic.link] paragraph 9 only
applies to entities with external linkage.</P>

<P>I don't remember why enumerators were given linkage; I don't
think it's necessary for mangling non-type template arguments.
In any event, I can't think why cross-TU name collisions between
enumerators and other entities would cause a problem, so I guess
a change here would be okay.  I can think of three changes that
would have that effect:</P>

<OL>
<LI>
Saying that enumerators do not have linkage.
</LI>
<LI>
Removing enumerators from the list of entities in the first
sentence of 3.5 [basic.link] paragraph 9.
</LI>
<LI>
Saying that it's okay for an enumerator in one TU to have the
same name as a class type in another TU only if the enumerator
hides that same class type in both TUs (the example you gave).
</LI>
</OL>

<P><U>Daveed Vandevoorde</U>:
I don't think any of these are sufficient in the sense that the problem
isn't limited to enumerators.  E.g.:
<PRE>
  struct X;
  extern void X();
</PRE>
shouldn't create cross-TU collisions either.</P>

<P><U>Mike Miller</U>:
So you're saying that cross-TU collisions should only be
prohibited if both names denote entities of the same kind (both
functions, both objects, both types, etc.), or if they are both
references (regardless of what they refer to, presumably)?</P>

<P><U>Daveed Vandevoorde</U>:
Not exactly.  Instead, I'm saying that if two entities (with
external linkage) can coexist when they're both declared in the
same translation unit (TU), then they should also be allowed to
coexist when they're declared in two different translation units.</P>

<P>For example:
<PRE>
  int i;
  void i();  // Error
</PRE>
This is an error within a TU, so I don't see a reason to make it
valid across TUs.</P>

<P>However, "tag names" (class/struct/union/enum) can sometimes
coexist with identically named entities (variables, functions &amp;
enumerators, but not namespaces, templates or type names).</P>

<BR><BR><HR><A NAME="371"></A><H4>371.
  
Interleaving of constructor calls
</H4><B>Section: </B>3.6.2&#160; [basic.start.init]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Matt Austern
 &#160;&#160;&#160;

 <B>Date: </B>7 August 2002<BR>




<P>Is a compiler allowed to interleave constructor calls when
performing dynamic initialization of nonlocal objects?
What I mean by interleaving is: beginning to execute a
particular constructor, then going off and doing
something else, then going back to the original constructor.
I can't find anything explicit about this in clause
3.6.2 [basic.start.init].</P>

<P>I'll present a few different examples, some of which get a
bit wild.  But a lot of what this comes down to is exactly
what the standard means when it talks about the order
of initialization.  If it says that some object x must be
initialized before a particular event takes place, does that
mean that x's constructor must be entered before that
event, or does it mean that it must be exited before that
event?  If object x must be initialized before object y,
does that mean that x's constructor must exit before y's
constructor is entered?</P>

<P>(The answer to that question might just be common sense,
but I couldn't find an answer in clause 3.6.2 [basic.start.init].
Actually, when I read 3.6.2 [basic.start.init]
carefully, I find there are a lot of things I took
for granted that aren't there.)</P>

<P>OK, so a few specific scenerios.</P>
<OL>
<LI>We have a translation unit with nonlocal objects A and B,
both of which require dynamic initialization.  A comes before
B.  A must be initialized before B.  May the compiler start
to construct A, get partway through the constructor, then
construct B, and then go back to finishing A?</LI>

<LI>We have a translation unit with nonlocal object A and
function f.  Construction of A is deferred until after the
first statement of main.  A must be constructed before the
first use of f.  Is the compiler permitted to start constructing
A, then execute f, then go back to constructing A?</LI>

<LI>We have nonlocal objects A and B, in two different
translation units.  The order in which A and B are constructed
is unspecified by the Standard.  Is the compiler permitted to
begin constructing A, then construct B, then finish A's
constructor?  Note the implications of a 'yes' answer.  If A's
and B's constructor both call some function f, then the call
stack might look like this:
<PRE>
   &lt;runtime gunk&gt;
     &lt;Enter A's constructor&gt;
        &lt;Enter f&gt;
           &lt;runtime gunk&gt;
              &lt;Enter B's constructor&gt;
                 &lt;Enter f&gt;
                 &lt;Leave f&gt;
              &lt;Leave B's constructor&gt;
        &lt;Leave f&gt;
     &lt;Leave A's constructor&gt;
</PRE>
The implication of a 'yes' answer for users is that any function
called by a constructor, directly or indirectly, must be reentrant.</LI>

<LI>This last example is to show why a 'no' answer to #3 might
be a problem too.  New scenerio: we've got one translation
unit containing a nonlocal object A and a function f1, and another
translation unit containing a nonlocal object B and a function f2.
A's constructor calls f2.  Initialization of A and B is deferred until
after the first statement of main().  Someone in main calls f1.
Question: is the compiler permitted to start constructing A, then
go off and construct B at some point before f2 gets called, then
go back and finish constructing A?  In fact, is the compiler
required to do that?  We've got an unpleasant tension here between
the bad implications of a 'yes' answer to #3, and the explicit
requirement in 3.6.2 [basic.start.init] paragraph 3.</LI>
</OL>

<P>At this point, you might be thinking we could avoid all of this
nonsense by removing compilers' freedom to defer initialization
until after the beginning of main().  I'd resist that, for two reasons.
First, it would be a huge change to make after the standard has
been out.  Second, that freedom is necessary if we want to have
support for dynamic libraries.  I realize we don't yet say anything
about dynamic libraries, but I'd hate to make decisions that would
make such support even harder.</P>

<BR><BR><HR><A NAME="1659"></A><H4>1659.
  
Initialization order of thread_local template static data members
</H4><B>Section: </B>3.6.2&#160; [basic.start.init]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-14<BR>


<P>According to 3.6.2 [basic.start.init] paragraph 5,</P>

<BLOCKQUOTE>

It is implementation-defined whether the dynamic initialization of a
non-local variable with static or thread storage duration is done before
the first statement of the initial function of the thread. If the
initialization is deferred to some point in time after the first statement
of the initial function of the thread, it shall occur before the first
odr-use (3.2 [basic.def.odr]) of any variable with thread storage
duration defined in the same translation unit as the variable to be
initialized.

</BLOCKQUOTE>

<P>This doesn't consider that initialization of instantiations of static
data members of class templates (which can be <TT>thread_local</TT>) are
unordered.  Presumably odr-use of such a static data member should not
trigger the initialization of any <TT>thread_local</TT> variable other than
that one?</P>

<BR><BR><HR><A NAME="640"></A><H4>640.
  
Accessing destroyed local objects of static storage duration
</H4><B>Section: </B>3.6.3&#160; [basic.start.term]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Howard Hinnant
 &#160;&#160;&#160;

 <B>Date: </B>30 July 2007<BR>




<P>3.6.3 [basic.start.term] paragraph 2 says,</P>

<BLOCKQUOTE>

If a function contains a local object of static storage duration
that has been destroyed and the function is called during the
destruction of an object with static storage duration, the
program has undefined behavior if the flow of control passes
through the definition of the previously destroyed local object.

</BLOCKQUOTE>

<P>I would like to turn this behavior from undefined to
well-defined behavior for the purpose of achieving a graceful
shutdown, especially in a multi-threaded world.</P>

<P>Background: Alexandrescu describes the &#8220;phoenix
singleton&#8221; in <I>Modern C++ Design</I>.  This is a class
used as a function local static, that will reconstruct itself,
and reapply itself to the <TT>atexit</TT> chain, if the program
attempts to use it after it is destructed in the <TT>atexit</TT>
chain.  It achieves this by setting a &#8220;destructed
flag&#8221; in its own state in its destructor.  If the object is
later accessed (and a member function is called on it), the
member function notes the state of the &#8220;destructed
flag&#8221; and does the reconstruction dance.  The phoenix
singleton pattern was designed to address issues only in
single-threaded code where accesses among static objects can have
a non-scoped pattern.  When we throw in multi-threading, and the
possibility that threads can be running after <TT>main</TT>
returns, the chances of accessing a destroyed static
significantly increase.</P>

<P>The very least that I would like to see happen is to standardize what  
I believe is existing practice:  When an object is destroyed in the  
<TT>atexit</TT> chain, the memory the object occupied is left in
whatever state the destructor put it in.  If this can only be
reliably done for objects with standard layout, that would be an
acceptable compromise.  This would allow objects to set &#8220;I'm
destructed&#8221; flags in their state and then do something
well-defined if accessed, such as throw an exception.</P>

<P>A possible refinement of this idea is to have the compiler set
up a 3-state flag around function-local statics instead of the
current 2-state flag:</P>

<UL>
<LI>Not constructed yet</LI>
<LI>Constructed but not destroyed yet</LI>
<LI>Destroyed</LI>
</UL>

<P>We have the first two states today.  We might choose to add
the third state, and if execution passes over a function-local
static with &#8220;destroyed&#8221; state, an exception could be
thrown.  This would mean that we would not have to guarantee
memory stability in destroyed objects of static duration.</P>

<P>This refinement would break phoenix singletons, and is not
required for the <TT>~mutex()</TT>/<TT>~condition()</TT> I've
described and prototyped.  But it might make it easier for Joe
Coder to apply this kind of guarantee to his own types.</P>

<BR><BR><HR><A NAME="365"></A><H4>365.
  
Storage duration and temporaries
</H4><B>Section: </B>3.7&#160; [basic.stc]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Kanze
 &#160;&#160;&#160;

 <B>Date: </B>24 July 2002<BR>


<P>There are several problems with 3.7 [basic.stc]:</P>
<UL>
<LI>
<P>3.7 [basic.stc] paragraph 2 says that "Static and automatic
storage durations are associated with objects introduced by
declarations (3.1 [basic.def]) and implicitly created
by the implementation (12.2 [class.temporary])."</P>

<P>In fact, objects "implicitly created by the implementation" are the
temporaries described in (12.2 [class.temporary]), and have neither
static nor automatic storage duration, but a totally different duration,
described in 12.2 [class.temporary].</P>
</LI>
<LI>
<P>3.7 [basic.stc] uses the expression "local object" in several 
places, without ever defining it.  Presumably, what is meant is "an 
object declared at block scope", but this should be said explicitly.</P>

<P>In a recent discussion in comp.lang.c++.moderated, on poster 
interpreted "local objects" as including temporaries.  This would require them 
to live until the end of the block in which they are created, which
contradicts 12.2 [class.temporary]. If temporaries are covered by
this section, and the statement in 3.7 [basic.stc]
seems to suggest, and they aren't local objects, then they must have
static storage duration, which isn't right either.</P>

<P>I propose adding a fourth storage duration to the list after
3.7 [basic.stc] paragraph 1:</P>
<UL>
<LI>
temporary storage duration
</LI>
</UL>
<P>And rewriting the second paragraph of this section as follows:</P>
<BLOCKQUOTE>
Temporary storage duration is associated with objects implicitly
created by the implementation, and is described in 12.2 [class.temporary].
Static and automatic storage durations are associated with objects defined
by declarations; in the following, an object defined by a declaration
with block scope is a local object.  The dynamic storage duration is
associated with objects created by the <TT>operator new</TT>.
</BLOCKQUOTE>
</LI>
</UL>

<P><U>Steve Adamczyk</U>:
There may well be an issue here, but one should bear in mind the
difference between storage duration and object lifetime.  As far
as I can see, there is no particular problem with temporaries having
automatic or static storage duration, as appropriate.  The point
of 12.2 [class.temporary] is that they have an unusual object
lifetime.</P>

<P><B>Notes from Ocrober 2002 meeting:</B></P>

<P>It might be desirable to shorten the storage duration of temporaries
to allow reuse of them.  The as-if rule allows some reuse, but such
reuse requires analysis, including noting whether the addresses of
such temporaries have been taken.</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>The CWG decided that further consideration of this issue would be
deferred until someone produces a paper explaining the need for action
and proposing specific changes.</P>

<BR><BR><HR><A NAME="2012"></A><H4>2012.
  
Lifetime of references
</H4><B>Section: </B>3.7&#160; [basic.stc]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-29<BR>




<P>According to 3.7 [basic.stc] paragraph 3,</P>

<BLOCKQUOTE>

The storage duration categories apply to references as
well. The lifetime of a reference is its storage duration.

</BLOCKQUOTE>

<P>This is clearly not correct; references can have static
storage duration but be dynamically initialized.  Consider an
example like:</P>

<PRE>
  extern int&amp; r1;
  int&amp; f();
  int&amp; r2 = r1;  //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
  int&amp; r1 = f();
  int i = r2;    //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
</PRE>

<P><TT>r1</TT> is not initialized until after its use at #1, so
the initialization of <TT>r2</TT> should produce undefined
behavior, as should the use of <TT>r2</TT> at #2.</P>

<P>The description of the lifetime of a reference should be
deleted from 3.7 [basic.stc] and it should be described
properly in 3.8 [basic.life].</P>

<BR><BR><HR><A NAME="1682"></A><H4>1682.
  
Overly-restrictive rules on function templates as allocation functions
</H4><B>Section: </B>3.7.4.1&#160; [basic.stc.dynamic.allocation]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2009-03-03<BR>




<P>Requirements for allocation functions are given in
3.7.4.1 [basic.stc.dynamic.allocation] paragraph 1:</P>

<BLOCKQUOTE>

An allocation function can be a function template. Such a template shall
declare its return type and first parameter as specified above (that is,
template parameter types shall not be used in the return type and first
parameter type). Template allocation functions shall have two or more
parameters.

</BLOCKQUOTE>

<P>There are a couple of problems with this description.  First, it is
instances of function templates that can be allocation functions, not
the templates themselves (cf 3.7.4.2 [basic.stc.dynamic.deallocation] paragraph 2,
which uses the correct terminology regarding deallocation functions).</P>

<P>More importantly, this specification was written before template
metaprogramming was understood and hence prevents use of SFINAE on the
return type or parameter type to select among function template
specializations.  (The parallel passage for deallocation functions in
3.7.4.2 [basic.stc.dynamic.deallocation] paragraph 2 shares this deficit.)</P>



<P>(See also <A HREF="
     cwg_active.html#1628">issue 1628</A>.)</P>

<BR><BR><HR><A NAME="523"></A><H4>523.
  
Can a one-past-the-end pointer be invalidated by deleting an adjacent object?
</H4><B>Section: </B>3.7.4.2&#160; [basic.stc.dynamic.deallocation]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>comp.std.c++
 &#160;&#160;&#160;

 <B>Date: </B>8 July 2005<BR>


<P>When an object is deleted, 3.7.4.2 [basic.stc.dynamic.deallocation] says
that the deallocation &#8220;[renders] invalid all pointers referring
to any part of the deallocated storage.&#8221; According to
3.9.2 [basic.compound] paragraph 3, a pointer whose address is
one past the end of an array is considered to point to an unrelated
object that happens to reside at that address.  Does this need to be
clarified to specify that the one-past-the-end pointer of an array is
not invalidated by deleting the following object?  (See also
5.3.5 [expr.delete] paragraph 4, which also mentions that
the system deallocation function renders a pointer invalid.)</P>

<BR><BR><HR><A NAME="419"></A><H4>419.
  
Can cast to virtual base class be done on partially-constructed object?
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Judy Ward
 &#160;&#160;&#160;

 <B>Date: </B>2 June 2003<BR>


<P>Consider</P>
<PRE>
  extern "C" int printf (const char *,...);

  struct Base { Base();};
  struct Derived: virtual public Base {
     Derived() {;}
  };

  Derived d;
  extern Derived&amp; obj = d;

  int i;

  Base::Base() {
    if ((Base *) &amp;obj) i = 4;
    printf ("i=%d\n", i);
  }

  int main() { return 0; }
</PRE>

<P>12.7 [class.cdtor] paragraph 2 makes this valid, but
3.8 [basic.life] paragraph 5 implies that it isn't valid.</P>

<P><U>Steve Adamczyk:</U>
A second issue:</P>
<PRE>
  extern "C" int printf(const char *,...);
  struct A                      { virtual ~A(); int x; };
  struct B : public virtual A   { };
  struct C : public B           { C(int); };
  struct D : public C           { D(); };
 
  int main()                    { D t; printf("passed\n");return 0; }
 
  A::~A()                       {} 
  C::C(int)                     {} 
  D::D() : C(this-&gt;x)           {}
</PRE>
<P><A HREF="
     cwg_defects.html#52">Core issue 52</A> almost, but not quite,
says that in evaluating "this-&gt;x"
you do a cast to the virtual base class A, which would be an error
according to 12.7 [class.cdtor] paragraph 2 because the base
class B constructor hasn't started yet.
5.2.5 [expr.ref] should be clarified to say that
the cast does need to get done.</P>

<P><U>James Kanze</U> submitted the same issue via comp.std.c++
on 11 July 2003:</P>
<BLOCKQUOTE>
Richard Smith:
Nonsense. You can use "this" perfectly happily in a constructor, just
be careful that (a) you're not using any members that are not fully
initialised, and (b) if you're calling virtual functions you know
exactly what you're doing.
</BLOCKQUOTE>

<P>In practice, and I think in intent, you are right.  However, the
standard makes some pretty stringent restrictions in
3.8 [basic.life].  To start
with, it says (in paragraph 1): </P>
<BLOCKQUOTE>
    The lifetime of an object is a runtime property of the object.  The
    lifetime of an object of type T begins when:
<UL>
<LI>
        storage with the proper alignment and size for type T is
        obtained, and
</LI>
<LI>

        if T is a class type with a non-trivial constructor, the
        constructor calls has COMPLETED.
</LI>
</UL>
    The lifetime of an object of type T ends when:
<UL>
<LI>
        if T is a class type with a non-trivial destructor, the
        destructor call STARTS, or
</LI>
<LI>
        the storage which the object occupies is reused or released.
</LI>
</UL>
</BLOCKQUOTE>
(Emphasis added.)  Then when we get down to paragraph 5, it says:
<BLOCKQUOTE>
<P>
    Before the lifetime of an object has started but after the storage
    which the object will occupy has been allocated [which sounds to me
    like it would include in the constructor, given the text above] or,
    after the lifetime of an object has ended and before the storage
    which the object occupied is reused or released, any pointer that
    refers to the storage location where the object will be or was
    located may be used but only in limited ways. [...] If the object
    will be or was of a non-POD class type, the program has undefined
    behavior if:
</P>
<P>
    [...]
</P>
<UL>
<LI>
        the pointer is implicitly converted to a pointer to a base class
        type, or [...]
</LI>
</UL>
</BLOCKQUOTE>

<P>I can't find any exceptions for the this pointer.</P>

<P>Note that calling a non-static function in the base class, or even
constructing the base class in initializer list, involves an implicit
conversion of this to a pointer to the base class.  Thus undefined
behavior.  I'm sure that this wasn't the intent, but it would seem to be
what this paragraph is saying.</P>

<BR><BR><HR><A NAME="1285"></A><H4>1285.
  
Trivial destructors and object lifetime
</H4><B>Section: </B>3.8&#160; [basic.life]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-04-02<BR>




<P>The Standard is self-contradictory regarding which destructor calls
end the lifetime of an object.  3.8 [basic.life] paragraph 1
says,</P>

<BLOCKQUOTE>

<P>The lifetime of an object of type T ends when:</P>

<UL><LI><P>if <TT>T</TT> is a class type with a non-trivial destructor
(12.4 [class.dtor]), the destructor call starts, or
</P></LI>

<LI><P>the storage which the object occupies is reused or released.
</P></LI>

</UL>

</BLOCKQUOTE>

<P>i.e., the lifetime of an object of a class type with a
trivial destructor persists until its storage is reused or released.
However, 12.4 [class.dtor] paragraph 15 says,</P>

<BLOCKQUOTE>

Once a destructor is invoked for an object, the object no longer
exists; the behavior is undefined if the destructor is invoked for an
object whose lifetime has ended (3.8 [basic.life]).

</BLOCKQUOTE>

<P>implying that invoking any destructor, even a trivial one, ends
the lifetime of the associated object.  Similarly, 12.7 [class.cdtor]
paragraph 1 says,</P>

<BLOCKQUOTE>

For an object with a non-trivial destructor, referring to any
non-static member or base class of the object after the destructor
finishes execution results in undefined behavior.

</BLOCKQUOTE>

<P>A similar question arises for
pseudo-destructors for non-class types.</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>CWG will need a paper exploring this topic before it can act on
the issue.</P>



<BR><BR><HR><A NAME="350"></A><H4>350.
  
<TT>signed char</TT> underlying representation for objects
</H4><B>Section: </B>3.9&#160; [basic.types]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Noah Stein
 &#160;&#160;&#160;

 <B>Date: </B>16 April 2002<BR>


<P>Sent in by David Abrahams:</P>

<P>Yes, and to add to this tangent, 3.9.1 [basic.fundamental]
paragraph 1 states "Plain char, signed char, and unsigned char are
three distinct types."  Strangely, 3.9 [basic.types]
paragraph 2 talks about how "... the underlying bytes making up
the object can be copied into an array of char or unsigned char.
If the content of the array of char or unsigned char is copied back
into the object, the object shall subsequently hold its original
value."  I guess there's no requirement that this copying
work properly with signed chars!</P>

<P><B>Notes from October 2002 meeting:</B></P>

<P>We should do whatever C99 does.  6.5p6 of the C99 standard says
"array of character type", and "character type" includes signed
char (6.2.5p15), and 6.5p7 says "character type".
But see also 6.2.6.1p4, which mentions (only) an array of unsigned char.</P>

<P><B>Proposed resolution (April 2003):</B></P>

<P>Change 3.8 [basic.life] paragraph 5 bullet 3 from</P>

<UL><LI>
the pointer is used as the operand of a
<TT>static_cast</TT>
(5.2.9 [expr.static.cast])
(except when the conversion is to
<TT>void*</TT>,
or to
<TT>void*</TT>
and subsequently to
<TT>char*</TT>,
or
<TT>unsigned</TT>
<TT>char*</TT>).
</LI>
</UL>

<P>to</P>

<UL><LI>
the pointer is used as the operand of a
<TT>static_cast</TT>
(5.2.9 [expr.static.cast])
(except when the conversion is to
<TT>void*</TT>,
or to
<TT>void*</TT>
and subsequently to a pointer to byte-character type).
</LI>
</UL>

<P>Change 3.8 [basic.life] paragraph 6 bullet 3 from </P>
<UL><LI>
the lvalue is used as the operand of a
<TT>static_cast</TT>
(5.2.9 [expr.static.cast])
(except when the conversion is ultimately to
<TT>char&amp;</TT>
or
<TT>unsigned</TT>
<TT>char&amp;</TT>),
or
</LI>
</UL>
<P>to</P>
<UL><LI>
the lvalue is used as the operand of a
<TT>static_cast</TT>
(5.2.9 [expr.static.cast])
(except when the conversion is ultimately to a reference to
byte-character type),
or
</LI>
</UL>

<P>Change the beginning of 3.9 [basic.types] paragraph 2 from</P>
<BLOCKQUOTE>
For any object (other than a base-class subobject) of POD type
<TT>T</TT>,
whether or not the object holds a valid value of type
<TT>T</TT>,
the underlying bytes (1.7 [intro.memory])
making up the object can be copied
into an array of
<TT>char</TT>
or
<TT>unsigned</TT>
<TT>char</TT>.
</BLOCKQUOTE>
<P>to</P>
<BLOCKQUOTE>
For any object (other than a base-class subobject) of POD type
<TT>T</TT>,
whether or not the object holds a valid value of type
<TT>T</TT>,
the underlying bytes (1.7 [intro.memory])
making up the object can be copied
into an array of byte-character type.
</BLOCKQUOTE>

<P>Add the indicated text to 3.9.1 [basic.fundamental] paragraph 1:</P>

<BLOCKQUOTE>
Objects declared as characters
(<TT>char</TT>)
shall be large enough to store any member of
the implementation's basic character set.
If a character from this set is stored in a character object,
the integral value of that character object
is equal to
the value of the single character literal form of that character.
It is implementation-defined whether a
<TT>char</TT>
object can hold negative values.
Characters can be explicitly declared
<TT>unsigned</TT>
or
<TT>signed</TT>.
Plain
<TT>char</TT>,
<TT>signed char</TT>,
and
<TT>unsigned char</TT>
are three distinct types<SPAN style="font-weight:bold;background-color:#A0FFA0">, called the <I>byte-character types</I></SPAN>.
A
<TT>char</TT>,
a
<TT>signed char</TT>,
and an
<TT>unsigned char</TT>
occupy the same amount of storage and have the same alignment requirements
(3.9 [basic.types]); that is, they have the
same object representation.
For <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-</SPAN>character types, all bits of the object representation participate in
the value representation.
For unsigned <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-</SPAN>character types, all possible bit
patterns of the value representation represent numbers.
These requirements
do not hold for other types.
In any particular implementation, a plain
<TT>char</TT>
object can take on either the same values as a
<TT>signed char</TT>
or an
<TT>unsigned char</TT>;
which one is implementation-defined.
</BLOCKQUOTE>

<P>Change 3.10 [basic.lval] paragraph 15 last bullet from</P>
<UL><LI>
a
<TT>char</TT>
or
<TT>unsigned</TT>
<TT>char</TT>
type.
</LI>
</UL>
<P>to</P>
<UL><LI>
a byte-character type.
</LI>
</UL>

<P><B>Notes from October 2003 meeting:</B></P>

<P>It appears that in C99 signed char may have padding bits but no trap
representation, whereas in C++ signed char has no padding bits but
may have -0.  A memcpy in C++ would have to copy the array preserving
the actual representation and not just the value.</P>

<P>March 2004: The liaisons to the C committee have been asked to tell us
whether this change would introduce any unnecessary incompatibilities
with C.</P>

<P><B>Notes from October 2004 meeting:</B></P>

<P>The C99 Standard appears to be inconsistent in its
requirements.  For example, 6.2.6.1 paragraph 4 says:</P>

<BLOCKQUOTE>

The value may be copied into an object of type
<TT>unsigned&#160;char&#160;[</TT><I>n</I><TT>]</TT> (e.g., by
<TT>memcpy</TT>); the resulting set of bytes is called the
<I>object representation</I> of the value.

</BLOCKQUOTE>

<P>On the other hand, 6.2 paragraph 6 says,</P>

<BLOCKQUOTE>

If a value is copied into an object having no declared type using
<TT>memcpy</TT> or <TT>memmove</TT>, or is copied as an array of
character type, then the effective type of the modified object
for that access and for subsequent accesses that do not modify
the value is the effective type of the object from which the
value is copied, if it has one.

</BLOCKQUOTE>

<P>Mike Miller will investigate further.</P>

<P><B>Proposed resolution (February, 2010):</B></P>

<OL><LI><P>Change 3.8 [basic.life] paragraph 5 bullet 4 as
follows:</P></LI>

<BLOCKQUOTE>

<P>...The program has undefined behavior if:</P>

<UL><LI><P>...</P></LI>

<LI><P>the pointer is used as the operand of a
<TT>static_cast</TT> (5.2.9 [expr.static.cast]) (except when
the conversion is to <SPAN style="font-weight:bold;background-color:#A0FFA0"><I>cv</I></SPAN> <TT>void*</TT>, or to
<SPAN style="font-weight:bold;background-color:#A0FFA0"><I>cv</I></SPAN> <TT>void*</TT> and subsequently to
<SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>char*</TT>, or <TT>unsigned char*</TT></SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a
pointer to a cv-qualified or cv-unqualified byte-character type
(3.9.1 [basic.fundamental])</SPAN>), or</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change 3.8 [basic.life] paragraph 6 bullet 4 as
follows:</P></LI>

<BLOCKQUOTE>

<P>...The program has undefined behavior if:</P>

<UL><LI><P>...</P></LI>

<LI><P>the lvalue is used as the operand of a
<TT>static_cast</TT> (5.2.9 [expr.static.cast]) except when the
conversion is ultimately to <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><I>cv</I> <TT>char&amp;</TT> or
<I>cv</I> <TT>unsigned char&amp;</TT></SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a reference to a
cv-qualified or cv-unqualified byte-character type (3.9.1 [basic.fundamental]) or an array thereof</SPAN>, or</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change 3.9 [basic.types] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

For any object (other than a base-class subobject) of trivially
copyable type <TT>T</TT>, whether or not the object holds a valid
value of type <TT>T</TT>, the underlying bytes (1.7 [intro.memory]) making up the object can be copied into an array of
<SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>char</TT> or <TT>unsigned char</TT></SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a
byte-character type (3.9.1 [basic.fundamental])</SPAN>.<SUP>39</SUP> If the content of
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">the</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">that</SPAN> array <SPAN style="text-decoration:line-through;background-color:#FFA0A0">of <TT>char</TT> or
<TT>unsigned char</TT></SPAN> is copied back into the object, the
object shall subsequently hold its original
value. [<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change 3.9.1 [basic.fundamental] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...Characters can be explicitly declared <TT>unsigned</TT> or
<TT>signed</TT>.  Plain <TT>char</TT>, <TT>signed char</TT>, and
<TT>unsigned char</TT> are three distinct types<SPAN style="font-weight:bold;background-color:#A0FFA0">, called the
<I>byte-character types</I></SPAN>.  A <TT>char</TT>, a <TT>signed
char</TT>, and an <TT>unsigned char</TT> occupy the same amount
of storage and have the same alignment requirements (3.11 [basic.align]); that is, they have the same object
representation. For <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-</SPAN>character types, all bits of
the object representation participate in the value
representation.  For <SPAN style="text-decoration:line-through;background-color:#FFA0A0">unsigned character types</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>unsigned char</TT></SPAN>, all possible bit patterns of
the value representation represent numbers...

</BLOCKQUOTE>

<LI><P>Change 3.10 [basic.lval] paragraph 15 final bullet
as follows:</P></LI>

<BLOCKQUOTE>

<P>If a program attempts to access the stored value of an object
through an lvalue of other than one of the following types the
behavior is undefined <SUP>52</SUP></P>

<UL>

<LI><P>...</P></LI>

<LI><P>a <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>char</TT> or <TT>unsigned char</TT></SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">byte-character</SPAN> type <SPAN style="font-weight:bold;background-color:#A0FFA0">(3.9.1 [basic.fundamental])</SPAN>.</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change 3.11 [basic.align] paragraph 6 as follows:</P></LI>

<BLOCKQUOTE>

The alignment requirement of a complete type can be queried using
an <TT>alignof</TT> expression (5.3.6 [expr.alignof]).
Furthermore, the <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-character</SPAN> types
<SPAN style="font-weight:bold;background-color:#A0FFA0">(3.9.1 [basic.fundamental])</SPAN> <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>char</TT>,
<TT>signed char</TT>, and <TT>unsigned char</TT></SPAN> shall have
the weakest alignment requirement.  [<I>Note:</I> this enables
the <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-</SPAN>character types to be used as the underlying
type for an aligned memory area (7.6.2 [dcl.align]). &#8212;<I>end note</I>]

</BLOCKQUOTE>

<LI><P>Change 5.3.4 [expr.new] paragraph 10 as follows:</P></LI>

<BLOCKQUOTE>

...For arrays of <SPAN style="text-decoration:line-through;background-color:#FFA0A0"><TT>char</TT> and <TT>unsigned
char</TT></SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">a byte-character type (3.9.1 [basic.fundamental])</SPAN>, the difference between the result of the
<I>new-expression</I> and the address returned by the allocation
function shall be an integral multiple of the strictest
fundamental alignment requirement (3.11 [basic.align]) of
any object type whose size is no greater than the size of the
array being created. [<I>Note:</I> Because allocation functions
are assumed to return pointers to storage that is appropriately
aligned for objects of any type with fundamental alignment, this
constraint on array allocation overhead permits the common idiom
of allocating <SPAN style="font-weight:bold;background-color:#A0FFA0">byte-</SPAN>character arrays into which objects
of other types will later be placed. &#8212;<I>end note</I>]

</BLOCKQUOTE>

</OL>

<P><B>Notes from the March, 2010 meeting:</B></P>

<P>The CWG was not convinced that there was a need to change the
existing specification at this time.  Some were concerned that there
might be implementation difficulties with giving <TT>signed char</TT>
the requisite semantics; implementations for which that is true can
currently make <TT>char</TT> equivalent to <TT>unsigned char</TT> and
avoid those problems, but the suggested change would undermine that
strategy.</P>

<P><B>Additional note, November, 2014:</B></P>

<P>There is now the term &#8220;narrow character type&#8221; that
should be used instead of &#8220;byte-character type&#8221;.</P>

<BR><BR><HR><A NAME="146"></A><H4>146.
  
Floating-point zero
</H4><B>Section: </B>3.9.1&#160; [basic.fundamental]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Andy Sawyer
 &#160;&#160;&#160;

 <B>Date: </B>23 Jul 1999<BR>





<P>3.9.1 [basic.fundamental]
 does not impose
a requirement on the floating point types that there be an exact
representation of the value zero.  This omission is significant in
4.12 [conv.bool]
 paragraph 1, in which any
non-zero value converts to the <TT>bool</TT> value <TT>true</TT>.</P>

<P>Suggested resolution: require that all floating point types have an
exact representation of the value zero.</P>
<BR><BR><HR><A NAME="251"></A><H4>251.
  
How many signed integer types are there?
</H4><B>Section: </B>3.9.1&#160; [basic.fundamental]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Beman Dawes
 &#160;&#160;&#160;

 <B>Date: </B>18 Oct 2000<BR>




<P>3.9.1 [basic.fundamental] paragraph 2 says that</P>

<BLOCKQUOTE>

There are four <I>signed integer types</I>: "<TT>signed char</TT>",
"<TT>short int</TT>", "<TT>int</TT>", and "<TT>long int</TT>."

</BLOCKQUOTE>

<P>This would indicate that <TT>const int</TT> is not a signed
integer type.</P>

<BR><BR><HR><A NAME="689"></A><H4>689.
  
Maximum values of signed and unsigned integers
</H4><B>Section: </B>3.9.1&#160; [basic.fundamental]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Kanze
 &#160;&#160;&#160;

 <B>Date: </B>30 March, 2008<BR>




<P>The relationship between the values representable by corresponding
signed and unsigned integer types is not completely described, but
3.9 [basic.types] paragraph 4 says,</P>

<BLOCKQUOTE>

The <I>value representation</I> of an object is the set of bits that
hold the value of type <TT>T</TT>.

</BLOCKQUOTE>

<P>and 3.9.1 [basic.fundamental] paragraph 3 says,</P>

<BLOCKQUOTE>

The range of nonnegative values of a signed integer type is a
subrange of the corresponding unsigned integer type, and the
value representation of each corresponding signed/unsigned type
shall be the same.

</BLOCKQUOTE>

<P>I.e., the maximum value of each unsigned type must be larger
than the maximum value of the corresponding signed type.</P>

<P>C90 doesn't have this restriction, and C99 explicitly says
(6.2.6.2, paragraph 2),</P>

<BLOCKQUOTE>

For signed integer types, the bits of the object representation
shall be divided into three groups: value bits, padding bits, and
the sign bit. There need not be any padding bits; there shall be
exactly one sign bit. Each bit that is a value bit shall have the
same value as the same bit in the object representation of the
corresponding unsigned type (if there are <I>M</I> value bits in the
signed type and N in the unsigned type, then <I>M</I> &lt;= <I>N</I>).

</BLOCKQUOTE>

<P>Unlike C++, the sign bit is not part of the value, and on an
architecture that does not have native support of unsigned types,
an implementation can emulate unsigned integers by simply
ignoring what would be the sign bit in the signed type and be
conforming.</P>

<P>The question is whether we intend to make a conforming
implementation on such an architecture impossible. More
generally, what range of architectures do we intend to
support?  And to what degree do we want to follow C99 in
its evolution since C89?</P>

<P>(See paper J16/08-0141 = WG21 N2631.)</P>

<BR><BR><HR><A NAME="1076"></A><H4>1076.
  
Value categories and lvalue temporaries
</H4><B>Section: </B>3.10&#160; [basic.lval]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2010-06-10<BR>


<P>The taxonomy of value categories in 3.10 [basic.lval]
classifies temporaries as prvalues.  However, some temporaries are
explicitly referred to as lvalues (cf 15.1 [except.throw]
paragraph 3).</P>

<BR><BR><HR><A NAME="238"></A><H4>238.
  
Precision and accuracy constraints on floating point
</H4><B>Section: </B>5&#160; [expr]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Christophe de Dinechin
 &#160;&#160;&#160;

 <B>Date: </B>31 Jul 2000<BR>




<P>It is not clear what constraints are placed on a floating point
implementation by the wording of the Standard.  For instance, is
an implementation permitted to generate a "fused multiply-add"
instruction if the result would be different from what would
be obtained by performing the operations separately?  To what
extent does the "as-if" rule allow the kinds of optimizations
(e.g., loop unrolling) performed by FORTRAN compilers?</P>

<BR><BR><HR><A NAME="1642"></A><H4>1642.
  
Missing requirements for prvalue operands
</H4><B>Section: </B>5&#160; [expr]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Joseph Mansfield
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-15<BR>


<P>Although the note in 3.10 [basic.lval] paragraph 1
states that</P>

<BLOCKQUOTE>

The discussion of each built-in operator in Clause
5 [expr] indicates the category of the value
it yields and the value categories of the operands it
expects

</BLOCKQUOTE>

<P>in fact, many of the operators that take prvalue operands
do not make that requirement explicit.  Possible approaches
to address this failure could be a blanket statement that an
operand whose value category is not stated is assumed to be
a prvalue; adding prvalue requirements to each operand
description for which it is missing; or changing the
description of the usual arithmetic conversions to state
that they imply the lvalue-to-rvalue conversion, which would
cover the majority of the omissions.</P>

<P>(See also <A HREF="
     cwg_closed.html#1685">issue 1685</A>, which deals with
an inaccurately-specified value category.)</P>

<BR><BR><HR><A NAME="1632"></A><H4>1632.
  
Lambda capture in member initializers
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Vinny Romano
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-04<BR>




<P>According to 5.1.2 [expr.prim.lambda] paragraph 9,</P>

<BLOCKQUOTE>

A <I>lambda-expression</I> whose smallest enclosing scope is a block scope
(3.3.3 [basic.scope.block]) is a local lambda expression; any
other <I>lambda-expression</I> shall not have a <I>capture-list</I> in
its <I>lambda-introducer</I>. The reaching scope of a local lambda
expression is the set of enclosing scopes up to and including the innermost
enclosing function and its parameters.

</BLOCKQUOTE>

<P>Consequently, lambdas appearing in <I>mem-initializer</I>s and
<I>brace-or-equal-initializer</I>s cannot have a <I>capture-list</I>.
However, these expressions are evaluated in the context of the
constructor and are permitted to access <TT>this</TT> and
non-static data members.</P>

<P>Should the definition of a local lambda be modified to permit
capturing lambdas within these contexts?</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>CWG agreed with the intent of this issue.</P>

<BR><BR><HR><A NAME="1743"></A><H4>1743.
  
<I>init-capture</I>s in nested lambdas
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Faisal Vali
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-30<BR>




<P>According to 5.2.1 [expr.sub] paragraph 11,</P>

<BLOCKQUOTE>

No entity is captured by an <I>init-capture</I>.

</BLOCKQUOTE>

<P>It should be made clearer that a variable, odr-used by
an <I>init-capture</I> in a nested lambda, is still captured by the
containing lambda as a result of the <I>init-capture</I>.</P>

<BR><BR><HR><A NAME="1822"></A><H4>1822.
  
Lookup of parameter names in <I>lambda-expression</I>s
</H4><B>Section: </B>5.1.2&#160; [expr.prim.lambda]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-10<BR>


<P>According to 5.1.2 [expr.prim.lambda] paragraph 7, names
appearing in the <I>compound-statement</I> of a
<I>lambda-expression</I> are looked up in the context of the
<I>lambda-expression</I>, ignoring the fact that the
<I>compound-statement</I> will be transformed into the body of
the closure type's function operator.  This leaves unspecified
how the <I>lambda-expression</I>'s parameters are found by
name lookup.  Presumably the parameters hide the corresponding
names from the surrounding scope, but this needs to be specified.</P>

<BR><BR><HR><A NAME="943"></A><H4>943.
  
Is <TT>T()</TT> a temporary?
</H4><B>Section: </B>5.2.3&#160; [expr.type.conv]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Miller
 &#160;&#160;&#160;

 <B>Date: </B>14 July, 2009<BR>


<P>According to 5.2.3 [expr.type.conv] paragraphs 1 and 3 (stated
directly or by reference to another section of the Standard), all the
following expressions create temporaries:</P>

<PRE>
    T(1)
    T(1, 2)
    T{1}
    T{}
</PRE>

<P>However, paragraph 2 says,</P>

<BLOCKQUOTE>

The expression <TT>T()</TT>, where <TT>T</TT> is a
<I>simple-type-specifier</I> or <I>typename-specifier</I> for a
non-array complete effective object type or the (possibly
cv-qualified) <TT>void</TT> type, creates an rvalue of the specified
type, which is value-initialized (8.5 [dcl.init]; no
initialization is done for the <TT>void()</TT> case).

</BLOCKQUOTE>

<P>This does <I>not</I> say that the result is a temporary, which
means that the lifetime of the result is not specified by
12.2 [class.temporary].  Presumably this is just an oversight.</P>

<P><B>Notes from the October, 2009 meeting:</B></P>

<P>The specification in 5.2.3 [expr.type.conv] is in error, not
because it fails to state that <TT>T()</TT> is a temporary but because
it requires a temporary for the other cases with fewer than two operands.
The case where <TT>T</TT> is a class type is covered by
12.2 [class.temporary] paragraph 1 (&#8220;a conversion that creates
an rvalue&#8221;), and a temporary should <I>not</I> be created when
<TT>T</TT> is not a class type.</P>

<BR><BR><HR><A NAME="742"></A><H4>742.
  
Postfix increment/decrement with long bit-field operands
</H4><B>Section: </B>5.2.6&#160; [expr.post.incr]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>11 November, 2008<BR>


<P>Given the following declarations:</P>

<PRE>
    struct S {
        signed long long sll: 3;
    };
    S s = { -1 };
</PRE>

<P>the expressions <TT>s.sll-- &lt; 0u</TT> and <TT>s.sll &lt; 0u</TT>
have different results.  The reason for this is that <TT>s.sll--</TT>
is an rvalue of type <TT>signed long long</TT> (5.2.6 [expr.post.incr]), which means that the usual arithmetic conversions
(5 [expr] paragraph 10) convert <TT>0u</TT> to
<TT>signed long long</TT> and the result is <TT>true</TT>.
<TT>s.sll</TT>, on the other hand, is a bit-field lvalue, which is
promoted (4.5 [conv.prom] paragraph 3) to <TT>int</TT>; both
operands of <TT>&lt;</TT> have the same rank, so <TT>s.sll</TT> is
converted to <TT>unsigned int</TT> to match the type of <TT>0u</TT>
and the result is <TT>false</TT>.  This disparity seems
undesirable.</P>

<BR><BR><HR><A NAME="1965"></A><H4>1965.
  
Explicit casts to reference types
</H4><B>Section: </B>5.2.7&#160; [expr.dynamic.cast]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-07<BR>




<P>The specification of <TT>dynamic_cast</TT> in
5.2.7 [expr.dynamic.cast] paragraph 2 (and <TT>const_cast</TT>
in 5.2.11 [expr.const.cast] is the same) says that the operand
of a cast to an lvalue reference type must be an lvalue, so that</P>

<PRE>
  struct A { virtual ~A(); }; A &amp;&amp;make_a();

  A &amp;&amp;a = dynamic_cast&lt;A&amp;&amp;&gt;(make_a());   //<SPAN style="font-family:Times;font-style:italic"> ok</SPAN>
  const A &amp;b = dynamic_cast&lt;const A&amp;&gt;(make_a()); //<SPAN style="font-family:Times;font-style:italic"> ill-formed</SPAN>
</PRE>

<P>The behavior of <TT>static_cast</TT> is an odd hybrid:</P>

<PRE>
  A &amp;&amp;c = static_cast&lt;A&amp;&amp;&gt;(make_b()); //<SPAN style="font-family:Times;font-style:italic"> ok</SPAN>
  const A &amp;d = static_cast&lt;const A&amp;&gt;(make_b()); //<SPAN style="font-family:Times;font-style:italic"> ok</SPAN>
  const B &amp;e = static_cast&lt;const B&amp;&gt;(make_a()); //<SPAN style="font-family:Times;font-style:italic"> ill-formed</SPAN>
</PRE>

<P>(Binding a const lvalue reference to an rvalue is permitted by
5.2.9 [expr.static.cast] paragraph 4 but not by paragraphs 2 and
3.)</P>

<P>There is implementation divergence on the treatment of these examples.</P>

<P>Also, <TT>const_cast</TT> permits binding an rvalue reference to a
class prvalue but not to any other kind of prvalue, which seems like an
unnecessary restriction.</P>

<P>Finally, 5.2.9 [expr.static.cast] paragraph 3 allows binding an
rvalue reference to a class or array prvalue, but not to other kinds of
prvalues; those are covered in paragraph 4.  This would be less confusing
if paragraph 3 only dealt with binding rvalue references to glvalues and
left all discussion of prvalues to paragraph 4, which adequately handles
the class and array cases as well.</P>

<BR><BR><HR><A NAME="282"></A><H4>282.
  
Namespace for <TT>extended_type_info</TT>
</H4><B>Section: </B>5.2.8&#160; [expr.typeid]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jens Maurer
 &#160;&#160;&#160;

 <B>Date: </B>01 May 2001<BR>


<P>The original proposed resolution for <A HREF="
     cwg_defects.html#160">issue 160</A>
included changing <TT>extended_type_info</TT>
(5.2.8 [expr.typeid] paragraph 1, footnote 61) to
<TT>std::extended_type_info</TT>.  There was no consensus on whether
this name ought to be part of namespace <TT>std</TT> or in a
vendor-specific namespace, so the question was moved into a
separate issue.</P>

<BR><BR><HR><A NAME="528"></A><H4>528.
  
Why are incomplete class types not allowed with <TT>typeid</TT>?
</H4><B>Section: </B>5.2.8&#160; [expr.typeid]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Dave Abrahams
 &#160;&#160;&#160;

 <B>Date: </B>18 May 2005<BR>




<P>5.2.8 [expr.typeid] paragraph 4 says,</P>

<BLOCKQUOTE>

When <TT>typeid</TT> is applied to a <I>type-id</I>, the result refers
to a <TT>std::type_info</TT> object representing the type of
the <I>type-id</I>.  If the type of the <I>type-id</I> is a reference
type, the result of the <TT>typeid</TT> expression refers to
a <TT>std::type_info</TT> object representing the referenced type. If
the type of the <I>type-id</I> is a class type or a reference to a
class type, the class shall be completely-defined.

</BLOCKQUOTE>

<P>I'm wondering whether this is not overly restrictive.  I can't
think of a reason to require that <TT>T</TT> be completely-defined
in <TT>typeid(T)</TT> when <TT>T</TT> is a class type.  In fact,
several popular compilers enforce that restriction
for <TT>typeid(T)</TT>, but not for <TT>typeid(T&amp;)</TT>.  Can
anyone explain this?
</P>

<P><U>Nathan Sidwell</U>: I think this restriction is so that whenever
the compiler has to emit a typeid object of a class type, it knows
what the base classes are, and can therefore emit an array of
pointers-to-base-class typeids.  Such a tree is necessary to implement
<TT>dynamic_cast</TT> and exception catching (in a commonly
implemented and obvious manner).  If the class could be incomplete,
the compiler might have to emit a typeid for incomplete <TT>Foo</TT>
in one object file and a typeid for complete <TT>Foo</TT> in another
object file.  The compilation system will then have to make sure that
(a) those compare equal and (b) the complete <TT>Foo</TT> gets
priority, if that is applicable.
</P>

<P>Unfortunately, there is a problem with exceptions that means there
still can be a need to emit typeids for incomplete class.  Namely one
can throw a pointer-to-pointer-to-incomplete.  To implement the
matching of pointer-to-derived being caught by pointer-to-base, it is
necessary for the typeid of a pointer type to contain a pointer to the
typeid of the pointed-to type.  In order to do the qualification
matching on a multi-level pointer type, one has a chain of pointer
typeids that can terminate in the typeid of an incomplete type.  You
cannot simply NULL-terminate the chain, because one must distinguish
between different incomplete types.</P>

<P><U>Dave Abrahams</U>: So if implementations are still required to
be able to do it, for all practical purposes, why aren't we letting
the user have the benefits?</P>

<P><B>Notes from the April, 2006 meeting:</B></P>

<P>There was some concern expressed that this might be difficult under
the IA64 ABI.  It was also observed that while it is necessary to
handle exceptions involving incomplete types, there is no requirement
that the RTTI data structures be used for exception handling.</P>

<BR><BR><HR><A NAME="1954"></A><H4>1954.
  
<TT>typeid</TT> null dereference check in subexpressions
</H4><B>Section: </B>5.2.8&#160; [expr.typeid]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>David Majnemer
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-23<BR>


<P>According to 5.2.8 [expr.typeid] paragraph 2,</P>

<BLOCKQUOTE>

If the glvalue expression is obtained by applying the
unary <TT>*</TT> operator to a pointer<SUP>69</SUP> and the
pointer is a null pointer value (4.10 [conv.ptr]),
the <TT>typeid</TT> expression throws an exception
(15.1 [except.throw]) of a type that would match a
handler of type
<TT>std::bad_typeid</TT> exception (18.7.3 [bad.typeid]).

</BLOCKQUOTE>

<P>The footnote makes clear that this requirement applies without
regard to parentheses, but it is unspecified whether it applies when
the dereference occurs in a subexpression of the operand (e.g., in
the second operand of the comma operator or the second or third
operand of a conditional operator).  There is implementation
divergence on this question.</P>

<BR><BR><HR><A NAME="944"></A><H4>944.
  
<TT>reinterpret_cast</TT> for all types with the same size and alignment
</H4><B>Section: </B>5.2.10&#160; [expr.reinterpret.cast]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Miller
 &#160;&#160;&#160;

 <B>Date: </B>15 July, 2009<BR>


<P>During the discussion of <A HREF="
     cwg_defects.html#799">issue 799</A>, which
specified the result of using <TT>reinterpret_cast</TT> to convert an
operand to its own type, it was observed that it is probably reasonable
to allow <TT>reinterpret_cast</TT> between any two types that have the
same size and alignment.</P>

<P><B>Additional note, April, 2015:</B></P>

<P>It has been suggested that this question may more properly be
the province of EWG, especially in light of discussions during
the resolution of <A HREF="
     cwg_defects.html#330">issue 330</A>.
</P>

<BR><BR><HR><A NAME="1230"></A><H4>1230.
  
Confusing description of ambiguity of destructor name
</H4><B>Section: </B>5.3.1&#160; [expr.unary.op]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2010-12-13<BR>




<P>According to 5.3.1 [expr.unary.op] paragraph 10,</P>

<BLOCKQUOTE>

There is an ambiguity in the <I>unary-expression</I> <TT>~X()</TT>,
where <TT>X</TT> is a <I>class-name</I> or <I>decltype-specifier</I>.
The ambiguity is resolved in favor of treating <TT>~</TT> as a
unary complement rather than treating <TT>~X</TT> as referring
to a destructor.

</BLOCKQUOTE>

<P>It is not clear whether this is intended to apply to an
expression like <TT>(~S)()</TT>.  In large measure, that depends on
whether a <I>class-name</I> is an <I>id-expression</I> or not.  If it
is, the ambiguity described in 5.3.1 [expr.unary.op] paragraph
10 does apply; if not, the expression is an unambiguous reference to
the destructor for class <TT>S</TT>.  There are several places in the
Standard that indicate that the name of a type is an
<I>id-expression</I>, but that might be more confusing than helpful.</P>

<BR><BR><HR><A NAME="267"></A><H4>267.
  
Alignment requirement for <I>new-expression</I>s
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Kuyper
 &#160;&#160;&#160;

 <B>Date: </B>4 Dec 2000<BR>


<P>Requirements for the alignment of pointers returned by
<I>new-expression</I>s are given in 5.3.4 [expr.new]
paragraph 10:</P>

<BLOCKQUOTE>

For arrays of <TT>char</TT> and <TT>unsigned char</TT>, the difference
between the result of the <I>new-expression</I> and the address
returned by the allocation function shall be an integral multiple of
the most stringent alignment requirement (3.9 [basic.types])
of any object type whose size is no greater than the size of the array
being created.

</BLOCKQUOTE>

<P>The intent of this wording is that the pointer returned by the
<I>new-expression</I> will be suitably aligned for any data type
that might be placed into the allocated storage (since the
allocation function is constrained to return a pointer to
maximally-aligned storage).  However, there is an implicit
assumption that each alignment requirement is an integral multiple
of all smaller alignment requirements.  While this is probably a
valid assumption for all real architectures, there's no reason
that the Standard should require it.</P>

<P>For example, assume that <TT>int</TT> has an alignment requirement
of 3 bytes and <TT>double</TT> has an alignment requirement of 4
bytes.  The current wording only requires that a buffer that is big
enough for an <TT>int</TT> or a <TT>double</TT> be aligned on a 4-byte
boundary (the more stringent requirement), but that would allow the
buffer to be allocated on an 8-byte boundary &#8212; which might
<I>not</I> be an acceptable location for an <TT>int</TT>.</P>

<P><U>Suggested resolution</U>: Change "of any object type" to
"of every object type."</P>

<P>A similar assumption can be found in
5.2.10 [expr.reinterpret.cast] paragraph 7:</P>

<BLOCKQUOTE>

...converting an rvalue of type "pointer to <TT>T1</TT>" to the type
"pointer to <TT>T2</TT>" (where ... the alignment requirements of
<TT>T2</TT> are no stricter than those of <TT>T1</TT>) and back to its
original type yields the original pointer value...

</BLOCKQUOTE>

<P><U>Suggested resolution</U>: Change the wording to</P>

<BLOCKQUOTE>

...converting an rvalue of type "pointer to <TT>T1</TT>" to the type
"pointer to <TT>T2</TT>" (where ...  the alignment requirements of
<SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>T1</TT> are an integer multiple of those of <TT>T2</TT></SPAN>)
and back to its original type yields the original pointer value...

</BLOCKQUOTE>

<P>The same change would also be needed in paragraph 9.</P>

<BR><BR><HR><A NAME="473"></A><H4>473.
  
Block-scope declarations of allocator functions
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>12 Jul 2004<BR>


<P>Looking up <TT>operator new</TT> in a <I>new-expression</I>
uses a different mechanism from ordinary lookup.  According to
5.3.4 [expr.new] paragraph 9,</P>

<BLOCKQUOTE>
If the <I>new-expression</I> begins with a unary <TT>::</TT>
operator, the allocation function's name is looked up in the
global scope. Otherwise, if the allocated type is a class type
<TT>T</TT> or array thereof, the allocation function's name is
looked up in the scope of <TT>T</TT>. If this lookup fails to
find the name, or if the allocated type is not a class type, the
allocation function's name is looked up in the global scope.
</BLOCKQUOTE>

<P>Note in particular that the scope in which the
<I>new-expression</I> occurs is not considered.  For example,</P>

<PRE>
    void f() {
        void* operator new(std::size_t, void*);
        int* i = new int;    // okay?
    }
</PRE>

<P>In this example, the implicit reference to <TT>operator
new(std::size_t)</TT> finds the global declaration, even though
the block-scope declaration of <tt>operator new</tt> with a
different signature would hide it from an ordinary reference.</P>

<P>This seems strange; either the block-scope declaration should
be ill-formed or it should be found by the lookup.</P>

<P><B>Notes from October 2004 meeting:</B></P>

<P>The CWG agreed that the block-scope declaration should not be
found by the lookup in a <I>new-expression</I>.  It would,
however, be found by ordinary lookup if the allocation function
were invoked explicitly.</P>

<BR><BR><HR><A NAME="1628"></A><H4>1628.
  
Deallocation function templates
</H4><B>Section: </B>5.3.4&#160; [expr.new]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-22<BR>




<P>According to 5.3.4 [expr.new] paragraphs 18-20, an
exception thrown during the initialization of an object allocated
by a <I>new-expression</I> will cause a deallocation
function to be called for the object's storage if a matching
deallocation function can be found.  The rules deal only with
functions, however; nothing is said regarding a mechanism by which
a deallocation function template might be instantiated to free the
storage, although 3.7.4.2 [basic.stc.dynamic.deallocation] paragraph 2 indicates
that a deallocation function can be an instance of a function
template.</P>

<P>One possibility for this processing might be to perform template
argument deduction on any deallocation function templates; if there
is a specialization that matches the allocation function, by the
criteria listed in paragraph 20, that function template would be
instantiated and used, although a matching non-template function would
take precedence as is the usual outcome of overloading between
function template specializations and non-template functions.</P>

<P>Another possibility might be to match non-template deallocation
functions with non-template allocation functions and template
deallocation functions with template allocation functions.</P>

<P>There is a slightly related wording problem in
5.3.4 [expr.new] paragraph 21:</P>

<BLOCKQUOTE>

If a placement deallocation function is called, it is passed the same
additional arguments as were passed to the placement allocation function,
that is, the same arguments as those specified with
the <I>new-placement</I> syntax.

</BLOCKQUOTE>

<P>This wording ignores the possibility of default arguments in the
allocation function, in which case the arguments passed to the
deallocation function might be a superset of those specified in the
<I>new-placement</I>.</P>

<P>(See also <A HREF="
     cwg_active.html#1682">issue 1682</A>.)</P>

<BR><BR><HR><A NAME="196"></A><H4>196.
  
Arguments to deallocation functions </H4><B>Section: </B>5.3.5&#160; [expr.delete]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Matt Austern
 &#160;&#160;&#160;

 <B>Date: </B>20 Jan 2000<BR>





<P>5.3.4 [expr.new]
 paragraph 10 says that
the result of an array allocation function and the value of the array
<I>new-expression</I> from which it was invoked may be different,
allowing for space preceding the array to be used for implementation
purposes such as saving the number of elements in the array.  However,
there is no corresponding description of the relationship between the
operand of an array <I>delete-expression</I> and the argument passed
to its deallocation function.</P>

<P>3.7.4.2 [basic.stc.dynamic.deallocation]

paragraph 3 does state that</P>

<BLOCKQUOTE>
the value supplied to <TT>operator delete[](void*)</TT> in the
standard library shall be one of the values returned by a previous
invocation of either <TT>operator new[](std::size_t)</TT> or
<TT>operator new[](std::size_t, const std::nothrow_t&amp;)</TT> in the
standard library.
</BLOCKQUOTE>

<P>This statement might be read as requiring an implementation, when
processing an array <I>delete-expression</I> and calling the
deallocation function, to perform the inverse of the calculation
applied to the result of the allocation function to produce the value
of the <I>new-expression</I>.
(5.3.5 [expr.delete]
 paragraph 2 requires
that the operand of an array <I>delete-expression</I> "be the pointer
value which resulted from a previous array <I>new-expression</I>.")
However, it is not completely clear whether the "shall" expresses an
implementation requirement or a program requirement (or both).
Furthermore, there is no direct statement about user-defined
deallocation functions.</P>

<P><B>Suggested resolution:</B> A note should be added to
5.3.5 [expr.delete]
 to clarify that any
offset added in an array <I>new-expression</I> must be subtracted in
the array <I>delete-expression</I>.</P>
<BR><BR><HR><A NAME="2023"></A><H4>2023.
  
Composite reference result type of conditional operator
</H4><B>Section: </B>5.16&#160; [expr.cond]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-16<BR>




<P>The conditional operator converts pointer operands to their composite
pointer type (5.16 [expr.cond] bullets 6.3 and 6.4).  Similar
treatment should be afforded to operands of reference type.</P>

<P>See also <A HREF="
     cwg_active.html#2018">issue 2018</A>.</P>

<BR><BR><HR><A NAME="1256"></A><H4>1256.
  
Unevaluated operands are not necessarily constant expressions
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-08<BR>




<P>The current definition of constant expressions appears to make
unevaluated operands constant expressions; for example,
<TT>new char[10]</TT> would seem to be a constant expression if it
appears as the operand of <TT>sizeof</TT>.  This seems wrong.</P>

<BR><BR><HR><A NAME="1826"></A><H4>1826.
  
<TT>const</TT> floating-point in constant expressions
</H4><B>Section: </B>5.20&#160; [expr.const]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Ville Voutilainen
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-04<BR>




<P>A <TT>const</TT> integer initialized with a constant can be
used in constant expressions, but a <TT>const</TT> floating
point variable initialized with a constant cannot.  This was
intentional, to be compatible with C++03 while encouraging the
consistent use of <TT>constexpr</TT>.  Some people have found
this distinction to be surprising, however.</P>

<P>It was also observed that allowing <TT>const</TT> floating
point variables as constant expressions would be an ABI-breaking
change, since it would affect lambda capture.</P>

<P>One possibility might be to deprecate the use of <TT>const</TT>
integral variables in constant expressions.</P>

<P><B>Additional note, April, 2015:</B></P>

<P>EWG requested CWG to allow use of <TT>const</TT> floating-point
variables in constant expressions.</P>

<BR><BR><HR><A NAME="157"></A><H4>157.
  
Omitted typedef declarator
</H4><B>Section: </B>7&#160; [dcl.dcl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>19 Aug 1999<BR>





<P>7 [dcl.dcl]
 paragraph 3 reads,</P>

<BLOCKQUOTE>
In a <I>simple-declaration</I>, the optional
<I>init-declarator-list</I> can be omitted only when... the
<I>decl-specifier-seq</I> contains either a <I>class-specifier</I>,
an <I>elaborated-type-specifier</I> with a <I>class-key</I>
(9.1 [class.name]
), or an
<I>enum-specifier</I>.  In these cases and whenever a
<I>class-specifier</I> or <I>enum-specifier</I> is present in the
<I>decl-specifier-seq</I>, the identifiers in those specifiers are
among the names being declared by the declaration...  In such cases,
and except for the declaration of an unnamed bit-field
(9.6 [class.bit]
), the
<I>decl-specifier-seq</I> shall introduce one or more names into the
program, or shall redeclare a name introduced by a previous
declaration.  [<I>Example:</I>

<PRE>
    enum { };           // <I>ill-formed</I>
    typedef class { };  // <I>ill-formed</I>
</PRE>

<I>&#8212;end example</I>]
</BLOCKQUOTE>

In the absence of any explicit restrictions in
7.1.3 [dcl.typedef]
, this paragraph appears
to allow declarations like the following:

<PRE>
    typedef struct S { };    // no declarator
    typedef enum { e1 };     // no declarator
</PRE>

In fact, the final example in
7 [dcl.dcl]
 paragraph 3 would seem to
indicate that this is intentional: since it is illustrating the
requirement that the <I>decl-specifier-seq</I> must introduce a name
in declarations in which the <I>init-declarator-list</I> is omitted,
presumably the addition of a class name would have made the example
well-formed.

<P>On the other hand, there is no good reason to allow such
declarations; the only reasonable scenario in which they might occur
is a mistake on the programmer's part, and it would be a service to
the programmer to require that such errors be diagnosed.</P>
<BR><BR><HR><A NAME="498"></A><H4>498.
  
Storage class specifiers in definitions of class members
</H4><B>Section: </B>7.1.1&#160; [dcl.stc]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Matt Austern
 &#160;&#160;&#160;

 <B>Date: </B>13 Jan 2005<BR>




<P>Suppose we've got this class definition:</P>

<PRE>
    struct X {
       void f();
       static int n;
    };
</PRE>

<P>I think I can deduce from the existing standard that the following 
member definitions are ill-formed:</P>

<PRE>
    static void X::f() { }
    static int X::n;
</PRE>

<P>To come to that conclusion, however, I have to put together several
things in different parts of the standard.  I would have expected to
find an explicit statement of this somewhere; in particular, I would
have expected to find it in 7.1.1 [dcl.stc].  I don't
see it there, or anywhere.</P>

<P><U>Gabriel Dos Reis</U>: Or in 3.5 [basic.link] which is
about linkage.  I would have expected that paragraph to say that that
members of class types have external linkage when the enclosing class
has an external linkage.  Otherwise 3.5 [basic.link]
paragraph 8:
</P>

<BLOCKQUOTE>

Names not covered by these rules have no linkage.

</BLOCKQUOTE>

<P>might imply that such members do not have linkage.</P>

<P><B>Notes from the April, 2005 meeting:</B></P>

<P>The question about the linkage of class members is already
covered by 3.5 [basic.link] paragraph 5.</P>

<BR><BR><HR><A NAME="1820"></A><H4>1820.
  
Qualified typedef names
</H4><B>Section: </B>7.1.3&#160; [dcl.typedef]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-05<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#482">issue 482</A> allows
a typedef to be redeclared in the same or a containing scope using
a qualified <I>declarator-id</I>.  This was not the principal
goal of the issue and is not supported by current implementations.
Should the prohibition of qualified <I>declarator-id</I>s be
reinstated for typedefs?</P>

<BR><BR><HR><A NAME="1894"></A><H4>1894.
  
<I>typedef-name</I>s and <I>using-declaration</I>s
</H4><B>Section: </B>7.1.3&#160; [dcl.typedef]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-16<BR>




<P>The resolution of <A HREF="
     cwg_defects.html#407">issue 407</A> does not
cover cases involving <I>using-declaration</I>s.  For example:</P>

<PRE>
  namespace A { struct S {}; }
  namespace B {
    //<SPAN style="font-family:Times;font-style:italic"> This is valid per <A HREF="
     cwg_defects.html#407">issue 407</A></SPAN>
    using A::S;
    typedef A::S S;
    struct S s;
  }
  namespace C {
    //<SPAN style="font-family:Times;font-style:italic"> The typedef does not redefine the name </SPAN>S<SPAN style="font-family:Times;font-style:italic"> in this</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> scope, so <A HREF="
     cwg_defects.html#407">issue 407</A>'s resolution does not apply.</SPAN>
    typedef A::S S;
    using A::S;
    //<SPAN style="font-family:Times;font-style:italic"> The name lookup here isn't ambiguous, because it only finds one</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> entity, but it finds both a typedef-name and a non-typedef-name referring</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> to that entity, so the standard doesn't appear to say whether this is valid.</SPAN>
    struct S s;
  }
</PRE>

<P>The same issue appears with <I>using-directive</I>s:</P>

<PRE>
  namespace D { typedef A::S S; }
  namespace E {
    using namespace A;
    using namespace D;
    struct S s; //<SPAN style="font-family:Times;font-style:italic"> ok? <A HREF="
     cwg_defects.html#407">issue 407</A> doesn't apply here either</SPAN>
  }
</PRE>

<P>One possibility might be to remove the rule that a <I>typedef-name</I>
declaration redefines an already-defined name and instead rely on
<TT>struct stat</TT>-style hiding, taking the non-<I>typedef-name</I>
if name lookup finds both and they refer to the same type.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG felt that these examples should be well-formed.</P>

<BR><BR><HR><A NAME="144"></A><H4>144.
  
Position of <TT>friend</TT> specifier
</H4><B>Section: </B>7.1.6.3&#160; [dcl.type.elab]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>22 Jul 1999<BR>





<P>7.1.6.3 [dcl.type.elab]
 paragraph 1 seems to
impose an ordering constraint on the elements of friend class
declarations.  However, the general rule is that declaration
specifiers can appear in any order.  Should</P>

<PRE>
    class C friend;
</PRE>

be well-formed?
<BR><BR><HR><A NAME="36"></A><H4>36.
  
<I>using-declaration</I>s in multiple-declaration contexts
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Andrew Koenig
 &#160;&#160;&#160;

 <B>Date: </B>20 Aug 1998<BR>





<P>Section 7.3.3 [namespace.udecl]
 paragraph 8 says:</P>
<BLOCKQUOTE>A <I>using-declaration</I> is a declaration and can therefore be used
repeatedly where (and only where) multiple declarations are allowed.</BLOCKQUOTE>
It contains the following example:
<PRE>
    namespace A {
            int i;
    }
    
    namespace A1 {
            using A::i;
            using A::i;             // OK: double declaration
    }
    
    void f()
    {
            using A::i;
            using A::i;             // error: double declaration
    }
</PRE>
However, if "<TT>using A::i;</TT>" is really a declaration, and not a definition, it is far from clear that repeating it should be an error in either context.
Consider:
<PRE>
    namespace A {
            int i;
            void g();
    }
    
    void f() {
            using A::g;
            using A::g;
    }
</PRE>
Surely the definition of f should be analogous to
<PRE>
    void f() {
            void g();
            void g();
    }
</PRE>
which is well-formed because "<TT>void g();</TT>" is a declaration and
not a definition.

<P>Indeed, if the double using-declaration for <TT>A::i</TT> is prohibited
in <TT>f</TT>, why should it be allowed in namespace <TT>A1</TT>?</P>

<P><B>Proposed Resolution (04/99):</B>

Change the comment "<TT>// error: double declaration</TT>" to
"<TT>// OK: double declaration</TT>".

(This should be reviewed against existing practice.)</P>

<P><B>Notes from 04/00 meeting:</B></P>

<P>The core language working group was unable to come to consensus
over what kind of declaration a <I>using-declaration</I> should
emulate.  In a straw poll, 7 members favored allowing
<I>using-declaration</I>s wherever a non-definition declaration could
appear, while 4 preferred to allow multiple <I>using-declaration</I>s
only in namespace scope (the rationale being that the permission for
multiple <I>using-declaration</I>s is primarily to support its use in
multiple header files, which are seldom included anywhere other than
namespace scope).  John Spicer pointed out that <TT>friend</TT>
declarations can appear multiple times in class scope and asked if
<I>using-declaration</I>s would have the same property under the "like
a declaration" resolution.</P>

<P>As a result of the lack of agreement, the issue was returned to
"open" status.  </P>

<P>See also issues
<A HREF="
     cwg_defects.html#56">56</A>, <A HREF="
     cwg_defects.html#85">85</A>,
and <A HREF="
     cwg_active.html#138">138</A>..</P>

<P><B>Additional notes (January, 2005):</B></P>

<P>Some related issues have been raised concerning the following
example (modified from a C++ validation suite test):</P>

<PRE>
    struct A
    {
        int i;
        static int j;
    };

    struct B : A { };
    struct C : A { };

    struct D : virtual B, virtual C
    {
        using B::i;
        using C::i;
        using B::j;
        using C::j;
    };
</PRE>

<P>Currently, it appears that the <I>using-declaration</I>s of
<TT>i</TT> are ill-formed, on the basis of 7.3.3 [namespace.udecl] paragraph 10:</P>

<BLOCKQUOTE>

Since a <I>using-declaration</I> is a declaration, the
restrictions on declarations of the same name in the same
declarative region (3.3 [basic.scope]) also apply to
<I>using-declaration</I>s.

</BLOCKQUOTE>

<P>Because the <I>using-declaration</I>s of <TT>i</TT> refer to
different objects, declaring them in the same scope is not
permitted under 3.3 [basic.scope].  It might, however,
be preferable to treat this case as many other ambiguities are:
allow the declaration but make the program ill-formed if a name
reference resolves to the ambiguous declarations.</P>

<P>The status of the <I>using-declaration</I>s of <TT>j</TT>,
however, is less clear.  They both declare the same entity and
thus do not violate the rules of 3.3 [basic.scope].
This might (or might not) violate the restrictions of
9.2 [class.mem] paragraph 1:</P>

<BLOCKQUOTE>

Except when used to declare friends (11.3 [class.friend])
or to introduce the name of a member of a base class into a
derived class (7.3.3 [namespace.udecl], _N3225_.11.3 [class.access.dcl]), <I>member-declaration</I>s declare members of the
class, and each such member-declaration shall declare at least
one member name of the class. A member shall not be declared
twice in the <I>member-specification</I>, except that a nested
class or member class template can be declared and then later
defined.

</BLOCKQUOTE>

<P>Do the <I>using-declaration</I>s of <TT>j</TT> repeatedly
declare the same member?  Or is the preceding sentence an
indication that a <I>using-declaration</I> is not a declaration
of a member?</P>



<BR><BR><HR><A NAME="813"></A><H4>813.
  
<TT>typename</TT> in a <I>using-declaration</I> with a non-dependent name
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>UK
 &#160;&#160;&#160;

 <B>Date: </B>3 March, 2009<BR><BR>


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

<P>7.3.3 [namespace.udecl] paragraph 20 says,</P>

<BLOCKQUOTE>

If a <I>using-declaration</I> uses the keyword <TT>typename</TT> and
specifies a dependent name (14.6.2 [temp.dep]), the name
introduced by the <I>using-declaration</I> is treated as a
<I>typedef-name</I> (7.1.3 [dcl.typedef]).

</BLOCKQUOTE>

<P>This wording does not address use of <TT>typename</TT> in a
<I>using-declaration</I> with a non-dependent name; the primary
specification of the <TT>typename</TT> keyword in 14.6 [temp.res] does not appear to describe this case, either.</P>

<BR><BR><HR><A NAME="852"></A><H4>852.
  
<I>using-declaration</I>s and dependent base classes
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2 April, 2009<BR>


<P>The status of an example like the following is unclear in the current
Standard:</P>

<PRE>
    struct B {
        void f();
    };
    template&lt;typename T&gt; struct S: T {
        using B::f;
    };
</PRE>

<P>7.3.3 [namespace.udecl] does not deal explicitly with dependent
base classes, but does say in paragraph 3,</P>

<BLOCKQUOTE>

In a <I>using-declaration</I> used as a <I>member-declaration</I>, the
<I>nested-name-specifier</I> shall name a base class of the class
being defined. If such a <I>using-declaration</I> names a constructor,
the <I>nested-name-specier</I> shall name a direct base class of the
class being defined; otherwise it introduces the set of declarations
found by member name lookup (10.2 [class.member.lookup], 3.4.3.1 [class.qual]).

</BLOCKQUOTE>

<P>In the definition of <TT>S</TT>, <TT>B::f</TT> is not a dependent
name but resolves to an apparently unrelated class.  However, because
<TT>S</TT> could be instantiated as <TT>S&lt;B&gt;</TT>, presumably
14.6 [temp.res] paragraph 8 would apply:</P>

<BLOCKQUOTE>

No diagnostic shall be issued for a template definition for which a
valid specialization can be generated.

</BLOCKQUOTE>

<P>Note also the resolution of <A HREF="
     cwg_defects.html#515">issue 515</A>,
which permitted a similar use of a dependent base class named with a
non-dependent name.</P>

<BR><BR><HR><A NAME="1742"></A><H4>1742.
  
<I>using-declaration</I>s and scoped enumerators
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-08-28<BR>




<P>A <I>using-declaration</I> cannot name a scoped enumerator, according
to 7.3.3 [namespace.udecl] paragraph 7.  This is presumably because
a scoped enumerator belongs to an enumeration scope and thus logically
cannot belong to the non-enumeration scope in which the
<I>using-declaration</I> appears.  It seems inconsistent, however, to
permit <I>using-declaration</I>s to name unscoped enumerators but not
scoped enumerators.</P>

<P>Also, 7.3.3 [namespace.udecl] paragraph 3 says,</P>

<BLOCKQUOTE>

In a <I>using-declaration</I> used as a <I>member-declaration</I>,
the <I>nested-name-specifier</I> shall name a base class of the class being
defined.

</BLOCKQUOTE>

<P>The consequence of this is that</P>

<PRE>
  enum E { e0 };
  void f() {
    using E::e0;
  }
</PRE>

<P>is well-formed, but</P>

<PRE>
  struct B {
    enum E { e0 };
  };
  struct D : B {
    using B::E::e0;
  };
</PRE>

<P>is not.  Again, this seems inconsistent.  Should these rules be
relaxed?</P>



<BR><BR><HR><A NAME="1903"></A><H4>1903.
  
What declarations are introduced by a non-member <I>using-declaration</I>?
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-26<BR>




<P>The set of declarations introduced by a <I>using-declaration</I> that
is a <I>member-declaration</I> is specified by 7.3.3 [namespace.udecl]
paragraph 3.  However, there is no corresponding specification for a
non-member <I>using-declaration</I>.</P>

<BR><BR><HR><A NAME="1907"></A><H4>1907.
  
<I>using-declaration</I>s and default arguments
</H4><B>Section: </B>7.3.3&#160; [namespace.udecl]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-30<BR>




<P>The status of an example like the following is not clear:</P>

<PRE>
  void f(int, int);
  template&lt;typename T&gt; void g(T t) { f(t); }
  void f(int, int = 0);
  void h() { g(0); }
</PRE>

<P>According to 14.6.4 [temp.dep.res] paragraph 1,</P>

<BLOCKQUOTE>

<P>In resolving dependent names, names from the following sources are
considered:</P>

<UL><LI><P>Declarations that are visible at the point of definition of the
template.</P></LI>

<LI>...</LI>

</UL>

</BLOCKQUOTE>

<P>If this is to be interpreted as meaning that only the declarations
that are visible at the point of definition can be used in overload
resolution for dependent calls, the call <TT>g(0)</TT> is ill-formed.
If, however, it is the names, not the declarations, that are captured,
then presumably the second declaration of <TT>f</TT> should be
considered, making the call well-formed.  There is implementation
divergence for this example.</P>

<P>The resolution of <A HREF="
     cwg_defects.html#1551">issue 1551</A> recently
clarified the requirements in similar cases
involving <I>using-declaration</I>s:</P>

<PRE>
  namespace N { void f(int, int); }
  using N::f;
  template&lt;typename T&gt; void g(T t) { f(t); }
  namespace N { void f(int, int = 0); }
  void h() { g(0); }
</PRE>

<P>The note added to 7.3.3 [namespace.udecl] paragraph 11
makes clear that the call <TT>g(0)</TT> is well-formed in this
example.</P>

<P>This outcome results in an unfortunate discrepancy between how default
arguments and overloaded functions are treated, even though default
arguments could conceptually be viewed as simply adding extra overloads for
the additional arguments.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG was unable to come to consensus regarding the desired outcome,
with an approximately equal split between desiring the first example
to be well-formed or ill-formed.  It was noted that the resolution of
<A HREF="
     cwg_defects.html#1850">issue 1850</A> makes the corresponding case
for non-dependent references ill-formed, with no diagnostic required.
Similar questions also apply to completing an array type, which also
involves a modification to an existing entity declaration in a given
scope.</P>

<BR><BR><HR><A NAME="563"></A><H4>563.
  
Linkage specification for objects
</H4><B>Section: </B>7.5&#160; [dcl.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>8 March 2006<BR>


<P>It is not clear whether some of the wording in 7.5 [dcl.link]
that applies only to function types and names ought also to apply to
object names.  In particular, paragraph 3 says,</P>

<BLOCKQUOTE>

Every implementation shall provide for linkage to functions written in
the C programming language, <TT>"C"</TT>, and linkage to C++
functions, <TT>"C++"</TT>.

</BLOCKQUOTE>

<P>Nothing is said about variable names, apparently meaning that
implementations need not provide C (or even C++!) linkage for
variable names.  Also, paragraph 5 says,</P>

<BLOCKQUOTE>

Except for functions with C++ linkage, a function declaration without
a linkage specification shall not precede the first linkage
specification for that function. A function can be declared without a
linkage specification after an explicit linkage specification has been
seen; the linkage explicitly specified in the earlier declaration is
not affected by such a function declaration.

</BLOCKQUOTE>

<P>There doesn't seem to be a good reason for these provisions not
to apply to variable names, as well.</P>

<BR><BR><HR><A NAME="1818"></A><H4>1818.
  
Visibility and inherited language linkage
</H4><B>Section: </B>7.5&#160; [dcl.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-12-04<BR>




<P>Does the language linkage of a block-scope declaration determine
the language linkage of a subsequent declaration of the same name in
a different scope?  For example,</P>

<PRE>
   extern "C" void f() {
     void g();    //<SPAN style="font-family:Times;font-style:italic"> Implicitly </SPAN>extern "C"
   }
   void g() { }   //<SPAN style="font-family:Times;font-style:italic"> Also </SPAN>extern "C"<SPAN style="font-family:Times;font-style:italic"> or linkage mismatch?</SPAN>
</PRE>

<P>In other contexts, inheritance of linkage requires that the earlier
declaration be visible, as in 3.5 [basic.link] paragraph 6:</P>

<BLOCKQUOTE>

The name of a function declared in block scope and the name
of a variable declared by a block scope <TT>extern</TT> declaration
have linkage. If there is a visible declaration of an entity
with linkage having the same name and type, ignoring
entities declared outside the innermost enclosing namespace
scope, the block scope declaration declares that same entity
and receives the linkage of the previous declaration.

</BLOCKQUOTE>

<P>The specification for language linkage in
7.5 [dcl.link] paragraph 5, however, makes no
mention of visibility:</P>

<BLOCKQUOTE>

A function can be declared without a linkage specification
after an explicit linkage specification has been seen; the
linkage explicitly specified in the earlier declaration is
not affected by such a function declaration.

</BLOCKQUOTE>

<BR><BR><HR><A NAME="1617"></A><H4>1617.
  
<TT>alignas</TT> and non-defining declarations
</H4><B>Section: </B>7.6.2&#160; [dcl.align]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2012-02-02<BR>




<P>According to 7.6.2 [dcl.align] paragraph 6,</P>

<BLOCKQUOTE>

If the defining declaration of an entity has an <I>alignment-specifier</I>,
any non-defining declaration of that entity shall either specify equivalent
alignment or have no <I>alignment-specifier</I>. Conversely, if any
declaration of an entity has an <I>alignment-specifier</I>, every defining
declaration of that entity shall specify an equivalent alignment. No
diagnostic is required if declarations of an entity have
different <I>alignment-specifier</I>s in different translation units.

</BLOCKQUOTE>

<P>Because this is phrased in terms of the definition of an entity,
an example like the following is presumably well-formed (even though
there can be no definition of <TT>n</TT>):</P>

<PRE>
   alignas(8) extern int n;
   alignas(16) extern int n;
</PRE>

<P>Is this intentional?</P>

<BR><BR><HR><A NAME="504"></A><H4>504.
  
Should use of a variable in its own initializer require a diagnostic?
</H4><B>Section: </B>8.3.2&#160; [dcl.ref]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

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

 <B>Date: </B>14 Apr 2005<BR>


<P> Split
off from <A HREF="
     cwg_active.html#453">issue 453</A>.</P>

<P>It is in general not possible to determine at compile time whether
a reference is used before it is initialized.  Nevertheless, there is
some sentiment to require a diagnostic in the obvious cases that can
be detected at compile time, such as the name of a reference appearing
in its own initializer.  The resolution of <A HREF="
     cwg_active.html#453">issue 453</A> originally made such uses ill-formed, but the CWG decided
that this question should be a separate issue.</P>

<P><B>Rationale (October, 2005):</B></P>

<P>The CWG felt that this error was not likely to arise very
often in practice.  Implementations can warn about such constructs,
and the resolution for <A HREF="
     cwg_active.html#453">issue 453</A> makes
executing such code undefined behavior; that seemed to address the
situation adequately.</P>

<P><B>Note (February, 2006):</B></P>

<P>Recent discussions  have suggested that undefined behavior be
reduced.  One possibility (broadening the scope of this issue to
include object declarations as well as references) was to require a
diagnostic if the initializer uses the value, but not just the
address, of the object or reference being declared:</P>

<PRE>
    int i = i;        //<SPAN style="font-family:Times;font-style:italic"> Ill-formed, diagnostic required</SPAN>
    void* p = &amp;p;     //<SPAN style="font-family:Times;font-style:italic"> Okay</SPAN>
</PRE>

<BR><BR><HR><A NAME="361"></A><H4>361.
  
Forward reference to default argument
</H4><B>Section: </B>8.3.6&#160; [dcl.fct.default]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>17 June 2002<BR>




<P>Is this program well-formed?</P>
<PRE>
  struct S {
    static int f2(int = f1()); // OK?
    static int f1(int = 2);
  };
  int main()
  {
    return S::f2();
  }
</PRE>
<P>A class member function can in general refer to class members that
are declared lexically later.  But what about referring to default
arguments of member functions that haven't yet been declared?</P>

<P>It seems to me that if f2 can refer to f1, it can also refer to the
default argument of f1, but at least one compiler disagrees.</P>

<P><B>Notes from the February, 2012 meeting:</B></P>

<P>Implementations seem to have come to agreement that this example
is ill-formed.</P>

<P><B>Additional note (March, 2013):</B></P>

<P>Additional discussion has occurred  suggesting
the following examples as illustrations of this issue:</P>

<PRE>
  struct B {
   struct A { int a = 0; };
   B(A = A());    //<SPAN style="font-family:Times;font-style:italic"> Not permitted?</SPAN>
  };
</PRE>

<P>as well as</P>

<PRE>
  struct C {
   struct A { int a = C().n; }; //<SPAN style="font-family:Times;font-style:italic"> can we use the default argument here?</SPAN>
   C(int k = 0);
   int n;
  };

  bool f();
  struct D {
   struct A { bool a = noexcept(B()); }; //<SPAN style="font-family:Times;font-style:italic"> can we use the default initializer here?</SPAN>
   struct B { int b = f() ? throw 0 : 0; };
  };
</PRE>

<P>(See also <A HREF="
     cwg_active.html#325">issue 325</A>.)</P>

<P><B>Additional note (October, 2013):</B></P>

<P><A HREF="
     cwg_defects.html#1330">Issue 1330</A> treats
<I>exception-specification</I>s like default arguments, evaluated in the
completed class type.  That raises the same questions regarding
self-referential <TT>noexcept</TT> clauses that apply to default
arguments.</P>

<BR><BR><HR><A NAME="1609"></A><H4>1609.
  
Default arguments and function parameter packs
</H4><B>Section: </B>8.3.6&#160; [dcl.fct.default]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jonathan Caves
 &#160;&#160;&#160;

 <B>Date: </B>2013-01-25<BR>




<P>It is not clear from 8.3.6 [dcl.fct.default] whether the
following is well-formed or not:</P>

<PRE>
  template&lt;typename... T&gt;
  void f2(int a = 0, T... b, int c = 1);

  f2&lt;&gt;(); //<SPAN style="font-family:Times;font-style:italic"> parameter </SPAN>a<SPAN style="font-family:Times;font-style:italic"> has the value </SPAN>0<SPAN style="font-family:Times;font-style:italic"> and parameter </SPAN>c<SPAN style="font-family:Times;font-style:italic"> has the value </SPAN>1
</PRE>

<P>(<TT>T... b</TT> is a non-deduced context per
14.8.2.5 [temp.deduct.type] paragraph 5, so the template arguments must
be specified explicitly.)</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>CWG agreed that the example should be ill-formed.</P>

<P><B>Additional note (August, 2013):</B></P>

<P>8.3.6 [dcl.fct.default] paragraph 4 explicitly allows for a function
parameter pack to follow a parameter with a default argument:</P>

<BLOCKQUOTE>

In a given function declaration, each parameter subsequent to a parameter
with a default argument shall have a default argument supplied in this or a
previous declaration or shall be a function parameter pack.

</BLOCKQUOTE>

<P>However, any instantiation of such a function template with a non-empty
pack expansion would result in a function declaration in which one or more
parameters without default arguments (from the pack expansion) would follow
a parameter with a default argument and thus would be ill-formed.  Such a
function template declaration thus violates 14.6 [temp.res]
paragraph 8:</P>

<BLOCKQUOTE>

If every valid specialization of a variadic template requires an empty
template parameter pack, the template is ill-formed, no diagnostic
required.

</BLOCKQUOTE>

<P>Although the drafting review teleconference of 2013-08-26 suggested
closing the issue as NAD, it is being kept open to discuss and resolve this
apparent contradiction.  </P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>CWG agreed that this example should be accepted; the restriction on
default arguments applies to the template declaration itself, not to
its specializations.</P>

<BR><BR><HR><A NAME="1962"></A><H4>1962.
  
Type of <TT>__func__</TT>
</H4><B>Section: </B>8.4.1&#160; [dcl.fct.def.general]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-04<BR>




<P>Two questions have arisen regarding the treatment of the type of the
<TT>__func__</TT> built-in variable.  First, some implementations
accept</P>

<PRE>
  void f() {
    typedef decltype(__func__) T;
    T x = __func__;
  }
</PRE>

<P>even though <TT>T</TT> is specified to be an array type.</P>

<P>In a related question, it was noted that <TT>__func__</TT>
is implicitly required to be unique in each function, and that
not only the value but the type of <TT>__func__</TT> are
implementation-defined; e.g., in something like</P>

<PRE>
  inline auto f() { return &amp;__func__; }
</PRE>

<P>the function type is implementation-specific.  These concerns could be
addressed by making the value a prvalue of type <TT>const char*</TT>
instead of an array lvalue.</P>

<BR><BR><HR><A NAME="670"></A><H4>670.
  
Copy initialization via derived-to-base conversion in the second step
</H4><B>Section: </B>8.5&#160; [dcl.init]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>20 December 2007<BR>




<P>In this example:</P>

<PRE>
    struct A {};

    struct B: A {
       B(int);
       B(B&amp;);
       B(A);
    };

    void foo(B);

    void bar() {
       foo(0);
    }
</PRE>

<P>we are copy-initializing a <TT>B</TT> from <TT>0</TT>. So by
13.3.1.4 [over.match.copy] we consider all the converting
constructors of <TT>B</TT>, and choose <TT>B(int)</TT> to create
a <TT>B</TT>.  Then, by 8.5 [dcl.init] paragraph 15, we
direct-initialize the parameter from that temporary <TT>B</TT>.  By
13.3.1.3 [over.match.ctor] we consider all constructors.  The copy
constructor cannot be called with a temporary, but <TT>B(A)</TT> is
callable.</P>

<P>As far as I can tell, the Standard says that this example is
well-formed, and calls <TT>B(A)</TT>.  EDG and G++ have rejected this
example with a message about the copy constructor not being callable,
but I have been unsuccessful in finding anything in the Standard that
says that we only consider the copy constructor in the second step of
copy-initialization.  I wouldn't mind such a rule, but it doesn't seem
to be there.  And implementing <A HREF="
     cwg_defects.html#391">issue 391</A>
causes G++ to start accepting the example.</P>

<P>This question came up before in
<A href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17431">a GCC bug
report</A>; in the discussion of that bug Nathan Sidwell said that
some EDG folks explained to him why the testcase is ill-formed, but
unfortunately didn't provide that explanation in the bug report.
</P>

<P>I think the resolution of <A HREF="
     cwg_defects.html#391">issue 391</A>
makes this example well-formed; it was previously ill-formed because
in order to bind the temporary <TT>B(0)</TT> to the argument of
<TT>A(const A&amp;)</TT> we needed to make another
temporary <TT>B</TT>, and that's what made the example ill-formed.  If
we want this example to stay ill-formed, we need to change something
else.</P>

<P><U>Steve Adamczyk:</U></P>

<P>I tracked down my response to Nathan at the time, and it related to
my paper N1232 (on the <TT>auto_ptr</TT> problem).  The change that
came out of that paper is in 13.3.3.1 [over.best.ics] paragraph
4:</P>

<BLOCKQUOTE>

However, when considering the argument of a user-defined conversion
function that is a candidate by 13.3.1.3 [over.match.ctor] when
invoked for the copying of the temporary in the second step of a class
copy-initialization, or by 13.3.1.4 [over.match.copy], 13.3.1.5 [over.match.conv], or 13.3.1.6 [over.match.ref] in all cases, only
standard conversion sequences and ellipsis conversion sequences are
allowed.

</BLOCKQUOTE>

<P>This is intended to prevent use of more than one implicit user-
defined conversion in an initialization.</P>

<P>I told Nathan <TT>B(A)</TT> can't be called because its argument
would require yet another user-defined conversion, but I was wrong.  I
saw the conversion from <TT>B</TT> to <TT>A</TT> and immediately
thought &#8220;user-defined,&#8221; but in fact because <TT>B</TT> is
a derived class of <TT>A</TT> the conversion according to 13.3.3.1 [over.best.ics] paragraph 6 is a derived-to-base Conversion (even
though it will be implemented by calling a copy constructor).</P>

<P>So I agree with you: with the analysis above and the change for
<A HREF="
     cwg_defects.html#391">issue 391</A> this example is well-formed.  We
should discuss whether we want to make a change to keep it
ill-formed.</P>

<BR><BR><HR><A NAME="233"></A><H4>233.
  
References vs pointers in UDC overload resolution
</H4><B>Section: </B>8.5.3&#160; [dcl.init.ref]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Matthias Meixner
 &#160;&#160;&#160;

 <B>Date: </B>9 Jun 2000<BR>


<P>There is an inconsistency in the handling of references
vs pointers in user defined conversions and overloading. The reason
for that is that the combination of 8.5.3 [dcl.init.ref] and
4.4 [conv.qual] circumvents the standard way of ranking
conversion functions, which was probably not the intention of the
designers of the standard.</P>

<P>Let's start with some examples, to show what it is about:</P>

<PRE>
    struct Z { Z(){} };

    struct A {
       Z x;

       operator Z *() { return &amp;x; }
       operator const Z *() { return &amp;x; }
    };

    struct B {
       Z x;

       operator Z &amp;() { return x; }
       operator const Z &amp;() { return x; }
    };

    int main()
    {
       A a;
       Z *a1=a;
       const Z *a2=a; // not ambiguous

       B b;
       Z &amp;b1=b;
       const Z &amp;b2=b; // ambiguous
    }
</PRE>

<P>So while both classes <TT>A</TT> and <TT>B</TT> are structurally
equivalent, there is a difference in operator overloading. I want to
start with the discussion of the pointer case (<TT>const Z
*a2=a;</TT>): 13.3.3 [over.match.best] is used to select the best
viable function. Rule 4 selects <TT>A::operator const Z*()</TT> as
best viable function using 13.3.3.2 [over.ics.rank] since the
implicit conversion sequence <TT>const Z*</TT> -&gt; <TT>const Z*</TT>
is a better conversion sequence than <TT>Z*</TT> -&gt; <TT>const
Z*</TT>.</P>

<P>So what is the difference to the reference case?  Cv-qualification
conversion is only applicable for pointers according to 4.4 [conv.qual]. According to 8.5.3 [dcl.init.ref] paragraphs
4-7 references are initialized by binding using the concept of
reference-compatibility. The problem with this is, that in this
context of binding, there is no conversion, and therefore there is
also no comparing of conversion sequences. More exactly all
conversions can be considered identity conversions according to
13.3.3.1.4 [over.ics.ref] paragraph 1, which compare equal
and which has the same effect.  So binding <TT>const Z*</TT> to
<TT>const Z*</TT> is as good as binding <TT>const Z*</TT> to
<TT>Z*</TT> in terms of overloading. Therefore <TT>const Z
&amp;b2=b;</TT> is ambiguous.  [13.3.3.1.4 [over.ics.ref]
paragraph 5 and 13.3.3.2 [over.ics.rank] paragraph 3 rule 3
(S1 and S2 are reference bindings ...) do not seem to apply to this
case]</P>

<P>There are other ambiguities, that result in the special treatment
of references: Example:</P>

<PRE>
    struct A {int a;};
    struct B: public A { B() {}; int b;};

    struct X {
       B x;
       operator A &amp;() { return x; }
       operator B &amp;() { return x; }
    };

    main()
    {
       X x;
       A &amp;g=x; // ambiguous
    }
</PRE>

<P>Since both references of class <TT>A</TT> and <TT>B</TT> are
reference compatible with references of class <TT>A</TT> and since
from the point of ranking of implicit conversion sequences they are
both identity conversions, the initialization is ambiguous.
</P>

<P>So why should this be a defect?</P>

<UL>

<LI>References behave fundamentally different from pointers in combination 
with user defined conversions, although there is no reason to have this
different treatment.</LI>

<LI>This difference only shows up in combination with user defined
conversion sequences, for all other cases, there are special rules,
e.g. 13.3.3.2 [over.ics.rank] paragraph 3 rule 3.</LI>

</UL>

<P>So overall I think this was not the intention of the authors of the
standard.</P>

<P>So how could this be fixed? For comparing conversion sequences (and
only for comparing) reference binding should be treated as if it was a
normal assignment/initialization and cv-qualification would have to be
defined for references. This would affect 8.5.3 [dcl.init.ref] paragraph 6, 4.4 [conv.qual] and probably
13.3.3.2 [over.ics.rank] paragraph 3.</P>

<P>Another fix could be to add a special case in 13.3.3 [over.match.best] paragraph 1. </P>

<BR><BR><HR><A NAME="2018"></A><H4>2018.
  
Qualification conversion vs reference binding
</H4><B>Section: </B>8.5.3&#160; [dcl.init.ref]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-07<BR>




<P>Qualification conversions are not considered when doing reference
binding, which leads to some unexpected results:</P>

<PRE>
  template&lt;typename T&gt; T make();
  struct B {}; struct D : B {};

  const int *p1 = make&lt;int*&gt;();           //<SPAN style="font-family:Times;font-style:italic"> ok, qualification conversion</SPAN>
  const int *const *p2 = make&lt;int**&gt;();   //<SPAN style="font-family:Times;font-style:italic"> ok, qualification conversion</SPAN>
  const int **p3 = make&lt;int**&gt;();         //<SPAN style="font-family:Times;font-style:italic"> error, not type safe</SPAN>

  const int &amp;r1 = make&lt;int&amp;&gt;();           //<SPAN style="font-family:Times;font-style:italic"> ok, binds directly</SPAN>
  const int *const &amp;r2 = make&lt;int*&amp;&gt;();   //<SPAN style="font-family:Times;font-style:italic"> weird, binds to a temporary</SPAN>
  const int *&amp;r3 = make&lt;int*&amp;&gt;();         //<SPAN style="font-family:Times;font-style:italic"> error</SPAN>

  const int &amp;&amp;x1 = make&lt;int&amp;&amp;&gt;();         //<SPAN style="font-family:Times;font-style:italic"> ok, binds directly</SPAN>
  const int *const &amp;&amp;x2 = make&lt;int*&amp;&amp;&gt;(); //<SPAN style="font-family:Times;font-style:italic"> weird, binds to a temporary</SPAN>
  const int *&amp;&amp;x3 = make&lt;int*&amp;&amp;&gt;();       //<SPAN style="font-family:Times;font-style:italic"> weird, binds to a temporary</SPAN>
</PRE>

<P>It might make sense to say that similar types are reference-related
and if there is a qualification conversion they are reference-compatible.</P>

<P>See also <A HREF="
     cwg_active.html#2023">issue 2023</A>.</P>

<BR><BR><HR><A NAME="1599"></A><H4>1599.
  
Lifetime of <TT>initializer_list</TT> underlying array
</H4><B>Section: </B>8.5.4&#160; [dcl.init.list]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2012-02-10<BR>




<P>The normative wording of 8.5.4 [dcl.init.list] regarding the
lifetime of the array underlying an <TT>initializer_list</TT> object
does not match the intent as specified in the example in paragraph 6
of that section, even after application of the resolution of
<A HREF="
     cwg_defects.html#1290">issue 1290</A>.  That example contains the
lines:</P>

<PRE>
  void f() {
    std::initializer_list&lt;int&gt; i3 = { 1, 2, 3 };
  }
</PRE>

<P>The commentary indicates that the lifetime of the array created
for the initialization of <TT>i3</TT> &#8220;persists for the lifetime
of the variable.&#8221;  However, that is not the effect of the
normative wording.  According to paragraph 3,</P>

<BLOCKQUOTE>

if <TT>T</TT> is a specialization of
<TT>std::initializer_list&lt;E&gt;</TT>, an <TT>initializer_list</TT>
object is constructed as described below and used to initialize the
object according to the rules for initialization of an object from a
class of the same type (8.5 [dcl.init]).
</BLOCKQUOTE>

<P>In other words, the underlying array for <TT>{1,2,3}</TT> in
the example is associated with the temporary and shares its lifetime;
its lifetime is not extended to that of the variable.</P>



<P><B>Notes from the February, 2014 meeting:</B></P>

<P>The resolution of <A HREF="
     cwg_active.html#1299">issue 1299</A>, clarifying
the relationship between temporary expressions and temporary objects, is
relevant to this issue.</P>

<BR><BR><HR><A NAME="1996"></A><H4>1996.
  
Reference list-initialization ignores conversion functions
</H4><B>Section: </B>8.5.4&#160; [dcl.init.list]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-04<BR>




<P>The specification for list-initialization of a reference does not
consider the existence of conversion functions.  Consequently, the
following example is ill-formed:</P>

<PRE>
  struct S { operator struct D &amp;(); } s;
  D &amp;d{s};
</PRE>

<BR><BR><HR><A NAME="511"></A><H4>511.
  
POD-structs with template assignment operators
</H4><B>Section: </B>9&#160; [class]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Alisdair Meredith
 &#160;&#160;&#160;

 <B>Date: </B>19 Mar 2005<BR>


<P>A POD-struct is not permitted to have a user-declared copy
assignment operator (9 [class] paragraph 4).  However, a
template assignment operator is not considered a copy assignment
operator, even though its specializations can be selected by overload
resolution for performing copy operations (12.8 [class.copy]
paragraph 9 and especially footnote 114).  Consequently, <TT>X</TT> in
the following code is a POD, notwithstanding the fact that copy
assignment (for a non-const operand) is a member function call
rather than a bitwise copy:</P>

<PRE>
    struct X {
      template&lt;typename T&gt; const X&amp; operator=(T&amp;);
    };
    void f() {
      X x1, x2;
      x1 = x2;  //<SPAN style="font-family:Times;font-style:italic"> calls </SPAN>X::operator=&lt;X&gt;(X&amp;)
    }
</PRE>

<P>Is this intentional?</P>

<BR><BR><HR><A NAME="1821"></A><H4>1821.
  
Qualified redeclarations in a class <I>member-specification</I>
</H4><B>Section: </B>9.2&#160; [class.mem]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-1205<BR>




<P>9.2 [class.mem] paragraph 1 allows nested classes, class
templates, and enumerations to be declared and then later defined in
the class <I>member-specification</I>.  There does not appear to be
a restriction on using a <I>qualified-id</I> in that definition.
Should such a restriction be added?</P>

<BR><BR><HR><A NAME="57"></A><H4>57.
  
Empty unions
</H4><B>Section: </B>9.5&#160; [class.union]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>13 Oct 1998<BR>



<P>There doesn't seem to be a prohibition in 9.5 [class.union]
 against a declaration
like</P>
<PRE>
    union { int : 0; } x;
</PRE>
Should that be valid?  If so, 8.5 [dcl.init]

paragraph 5 third bullet, which deals with
default-initialization of unions, should say that no initialization is
done if there are no data members.
    
<P>What about:</P>
<PRE>
    union { } x;
    static union { };
</PRE>
If the first example is well-formed, should either or both of these cases
be well-formed as well?

<P>(See also the resolution for
<A HREF="
     cwg_defects.html#151">issue 151</A>.)</P>

<P><B>Notes from 10/00 meeting:</B> The resolution to
<A HREF="
     cwg_defects.html#178">issue 178</A>, which was accepted as a
DR, addresses the first point above (default initialization).
The other questions have not yet been decided, however.</P>
<BR><BR><HR><A NAME="1943"></A><H4>1943.
  
Unspecified meaning of &#8220;bit&#8221;
</H4><B>Section: </B>9.6&#160; [class.bit]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>


<P>CWG decided at the 2014-06 (Rapperswil) meeting to address
only a limited subset of the questions raised by issues
<A HREF="
     cwg_active.html#1857">1857</A> and
<A HREF="
     cwg_active.html#1861">1861</A>.  This issue is a placeholder for
the remaining questions, such as defining a &#8220;bit&#8221; in
terms of a value of 2<SUP><I>n</I></SUP>, specifying whether a bit-field
has a sign bit, etc.</P>

<BR><BR><HR><A NAME="380"></A><H4>380.
  
Definition of "ambiguous base class" missing
</H4><B>Section: </B>10.2&#160; [class.member.lookup]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>22 Oct 2002<BR>


<P>The term "ambiguous base class" doesn't seem to be actually defined
anywhere.  10.2 [class.member.lookup] paragraph 7 seems like the place
to do it.</P>

<BR><BR><HR><A NAME="600"></A><H4>600.
  
Does access control apply to members or to names?
</H4><B>Section: </B>11&#160; [class.access]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Alisdair Meredith
 &#160;&#160;&#160;

 <B>Date: </B>3 October 2006<BR>


<P>Referring to a private member of a class, 11 [class.access]
paragraph 1 says,</P>

<BLOCKQUOTE>

its name can be used only by members and friends of the class in which
it is declared.

</BLOCKQUOTE>

<P>That wording does not appear to reflect the intent of access control,
however.  Consider the following:</P>

<PRE>
    struct S {
        void f(int);
    private:
        void f(double);
    };

    void g(S* sp) {
        sp-&gt;f(2);        //<SPAN style="font-family:Times;font-style:italic"> Ill-formed?</SPAN>
    }
</PRE>

<P>The statement from 11 [class.access] paragraph 1 says that the
name <TT>f</TT> can be used only by members and friends of <TT>S</TT>.
Function <TT>g</TT> is neither, and it clearly contains a use of the
name <TT>f</TT>.  That appears to make it ill-formed, in spite of the fact
that overload resolution will select the public member.</P>

<P>A related question is whether the use of the term &#8220;name&#8221;
in the description of the effect of access control means that it does
not apply to constructors and destructors, which do not have names.</P>

<P><U>Mike Miller</U>: The phrase &#8220;its name can be used&#8221;
should be understood as &#8220;it can be referred to by name.&#8221;
Paragraph 4, among other places, makes it clear that access control is
applied after overload resolution.  The &#8220;name&#8221; phrasing is
there to indicate that access control does not apply where the name is
not used (in a call via a pointer, for example).</P>

<BR><BR><HR><A NAME="360"></A><H4>360.
  
Using-declaration that reduces access
</H4><B>Section: </B>11.2&#160; [class.access.base]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>4 June 2002<BR>




<P>I have heard a claim that the following code is valid, but I don't
see why.</P>
<PRE>
  struct A {
    int foo ();
  };

  struct B: A {
  private:
    using A::foo;
  };

  int main ()
  {
    return B ().foo ();
  }
</PRE>
<P>
It seems to me that the using declaration in B should hide the
public foo in A. Then the call to B::foo should fail because B::foo
is not accessible in main.</P>

<P>Am I missing something?</P>

<P><U>Steve Adamczyk</U>:
This is similar to the last example in 11.2 [class.access.base].
In prose, the rule is
that if you have access to cast to a base class and you have access
to the member in the base class, you are given access in the derived
class.  In this case, A is a public base class of B and foo is public
in A, so you can access foo through a B object.  The actual permission
for this is in the fourth bullet in
11.2 [class.access.base] paragraph 4.</P>

<P>The wording changes for <A HREF="
     cwg_defects.html#9">issue 9</A>
make this clearer, but I believe
even without them this example could be discerned to be valid.</P>

<P>See my paper J16/96-0034, WG21/N0852 on this topic.</P>

<P><U>Steve Clamage</U>:
But a using-declaration is a declaration (7.3.3 [namespace.udecl]).
Compare with</P>
<PRE>
  struct B : A {
  private:
    int foo();
  };
</PRE>
<P>In this case, the call would certainly be invalid, even though your
argument about casting B to an A would make it OK. Your argument
basically says that an access adjustment to make something less
accessible has no effect. That also doesn't sound right.</P>

<P><U>Steve Adamczyk</U>:
I agree that is strange.  I do think that's what 11.2 [class.access.base]
says, but perhaps that's not what we want it to say.</P>

<BR><BR><HR><A NAME="718"></A><H4>718.
  
Non-class, non-function friend declarations
</H4><B>Section: </B>11.3&#160; [class.friend]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>18 September, 2008<BR>


<P>With the change from a scope-based to an entity-based definition
of friendship (see issues <A HREF="
     cwg_defects.html#372">372</A> and
<A HREF="
     cwg_defects.html#580">580</A>), it could well make sense to
grant friendship to enumerations and variables, for example:</P>

<PRE>
    enum E: int;
    class C {
      static const int i = 5;  //<SPAN style="font-family:Times;font-style:italic"> Private</SPAN>
      friend E;
      friend int x;
    };
    enum E { e = C::i; };      //<SPAN style="font-family:Times;font-style:italic"> OK: </SPAN>E<SPAN style="font-family:Times;font-style:italic"> is a friend</SPAN>
    int x = C::i;              //<SPAN style="font-family:Times;font-style:italic"> OK: </SPAN>x<SPAN style="font-family:Times;font-style:italic"> is a friend</SPAN>
</PRE>

<P>According to the current wording of 11.3 [class.friend]
paragraph 3, the friend declaration of <TT>E</TT> is well-formed
but ignored, while the friend declaration of <TT>x</TT> is
ill-formed.</P>

<BR><BR><HR><A NAME="581"></A><H4>581.
  
Can a templated constructor be explicitly instantiated or specialized?
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mark Mitchell
 &#160;&#160;&#160;

 <B>Date: </B>19 May 2006<BR>


<P>Although it is not possible to specify a constructor's template
arguments in a constructor invocation (because the constructor has
no name but is invoked by use of the constructor's class's name), it
is possible to &#8220;name&#8221; the constructor in declarative
contexts: per 3.4.3.1 [class.qual] paragraph 2,</P>

<BLOCKQUOTE>

In a lookup in which the constructor is an acceptable lookup result,
if the <I>nested-name-specifier</I> nominates a class <TT>C</TT>, and
the name specified after the <I>nested-name-specifier</I>, when looked
up in <TT>C</TT>, is the injected-class-name of <TT>C</TT> (clause
9 [class]), the name is instead considered to name the
constructor of class <TT>C</TT>... Such a constructor name shall be
used only in the <I>declarator-id</I> of a declaration that names a
constructor.

</BLOCKQUOTE>

<P>Should it therefore be possible to specify <I>template-argument</I>s
for a templated constructor in an explicit instantiation or specialization?
For example,</P>

<PRE>
    template &lt;int dim&gt; struct T {};
    struct X {
      template &lt;int dim&gt; X (T&lt;dim&gt; &amp;) {};
    };

    template X::X&lt;&gt; (T&lt;2&gt; &amp;);
</PRE>

<P>If so, that should be clarified in the text.  In
particular, 12.1 [class.ctor] paragraph 1 says,</P>

<BLOCKQUOTE>

Constructors do not have names. A special declarator syntax using an
optional sequence of <I>function-specifier</I>s (7.1.2 [dcl.fct.spec]) followed by the constructor's class name followed by
a parameter list is used to declare or define the constructor.

</BLOCKQUOTE>

<P>This certainly sounds as if the parameter list must immediately
follow the class name, with no allowance for a template argument
list.</P>

<P>It would be worthwhile in any event to revise this wording
to utilize the &#8220;considered to name&#8221; approach of
3.4.3.1 [class.qual]; as it stands, this wording
sounds as if the following would be acceptable:</P>

<PRE>
    struct S {
        S();
    };
    S() { }    // <SPAN style="font-family:Times;font-style:italic">qualified-id</SPAN> not required?
</PRE>

<P><B>Notes from the October, 2006 meeting:</B></P>

<P>It was observed that explicitly specifying the template arguments
in a constructor declaration is never actually necessary because the
arguments are, by definition, all deducible and can thus be omitted.</P>

<BR><BR><HR><A NAME="1808"></A><H4>1808.
  
Constructor templates vs default constructors
</H4><B>Section: </B>12.1&#160; [class.ctor]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-11-12<BR>




<P>It is not clear when, if ever, a constructor template can be
considered to provide a default constructor.  For example:</P>

<PRE>
  struct A {
    template&lt;typename ...T&gt; A(T...); //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    A(std::initializer_list&lt;long&gt;);  //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
  };
  A a{};
</PRE>

<P>According to 8.5.4 [dcl.init.list] paragraph 3, <TT>A</TT>
will be value-initialized if it has a default constructor, and
there is implementation divergence whether this example calls #1
or #2.</P>

<P>Similarly, for an example like</P>

<PRE>
  struct B {
    template&lt;typename T=int&gt; B(T = 0);
  };
</PRE>

<P>it is not completely clear whether a default constructor should
be implicitly declared or not.</P>

<P>More generally, do utterances in the Standard concerning
&#8220;constructors&#8221; also apply to constructor templates?</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>One possibility discussed was that we may need to change places that
explicitly refer to a default constructor to use overload resolution,
similar to the change that was made a few years ago with regard to copy
construction vs &#8220;copy constructor.&#8221;  One additional use of
&#8220;default constructor&#8221; is in determining the triviality of a
class, but it might be a good idea to remove the concept of a trivial
class altogether.  This possibility will be explored.</P>

<BR><BR><HR><A NAME="1969"></A><H4>1969.
  
Missing exclusion of <TT>~S</TT> as an ordinary function name
</H4><B>Section: </B>12.4&#160; [class.dtor]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-14<BR>


<P>There does not appear to be wording to exclude use of a name like
<TT>~S</TT> for entities other than destructors.</P>

<BR><BR><HR><A NAME="607"></A><H4>607.
  
Lookup of <I>mem-initializer-id</I>s
</H4><B>Section: </B>12.6.2&#160; [class.base.init]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Corden
 &#160;&#160;&#160;

 <B>Date: </B>5 December 2006<BR>




<P>In an example like,</P>

<PRE>
    struct Y {};

    template &lt;typename T&gt;
    struct X : public virtual Y { };

    template &lt;typename T&gt;
    class A : public X&lt;T&gt; {
      template &lt;typename S&gt;
      A (S)
        : S ()
      {
      }
    };

    template A&lt;int&gt;::A (Y);
</PRE>

<P>Should <TT>S</TT> be found?  (<TT>S</TT> is a dependent name, so
if it resolves to a base class type in the instantiated template, it
should satisfy the requirements.)  All the compilers I tried allowed
this example, but 12.6.2 [class.base.init] paragraph 2 says,</P>

<BLOCKQUOTE>

Names in a <I>mem-initializer-id</I> are looked up in the scope
of the constructor's class and, if not found in that scope, are
looked up in the scope containing the constructor's definition.

</BLOCKQUOTE>

<P>The name <TT>S</TT> is not declared in those scopes.</P>

<P><U>Mike Miller</U>: Here's another example that is accepted by
most/all compilers but not by the current wording:</P>

<PRE>
    namespace N {
      struct B { B(int); };
      typedef B typedef_B;
      struct D: B {
        D();
      };
    }

    N::D::D(): typedef_B(0) { }
</PRE>

<P>Except for the fact that the constructor function parameter
names are ignored (see paragraph 7), what the compilers seem to
be doing is essentially ordinary unqualified name lookup.</P>

<P><B>Notes from the October, 2009 meeting:</B></P>

<P>The eventual resolution of this issue should take into account the
template parameter scope introduced by the resolution of
<A HREF="
     cwg_defects.html#481">issue 481</A>.</P>

<BR><BR><HR><A NAME="6"></A><H4>6.
  
Should the optimization that allows a class object to alias another object also allow the case of a parameter in an inline function to alias its argument?
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>unknown
 &#160;&#160;&#160;

 <B>Date: </B>unknown<BR>



<P>[Picked up by evolution group at October 2002 meeting.]</P>


 
(See also paper J16/99-0005 = WG21 N1182.)

<P>At the London meeting,
12.8 [class.copy]
 paragraph 31 was changed to
limit the optimization described to only the following cases:</P>
<UL>
<LI>
the source is a temporary object</LI>
    
<LI>
the return value optimization</LI>
</UL>
One other case was deemed desirable as well:
<UL>
<LI>
aliasing a parameter in an inline function call to the function call argument.</LI>
</UL>
However, there are cases when this aliasing was deemed undesirable and,
at the London meeting, the committee was not able to clearly delimit which
cases should be allowed and which ones should be prohibited.
    
<P>Can we find an appropriate description for the desired cases?</P>
    
<P><B>Rationale (04/99):</B> The absence of this optimization does
not constitute a defect in the Standard,
although the proposed resolution in the paper
should be considered when the Standard is revised.</P>

<P><B>Note (March, 2008):</B></P>

<P>The Evolution Working Group has accepted the intent of this issue and
referred it to CWG for action (not for C++0x).  See paper J16/07-0033 =
WG21 N2173.</P>

<P><B>Notes from the June, 2008 meeting:</B></P>

<P>The CWG decided to take no action on this issue until an interested
party produces a paper with analysis and a proposal.</P>
<BR><BR><HR><A NAME="1049"></A><H4>1049.
  
Copy elision through reference parameters of inline functions
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2010-03-10<BR>




<P>Consider the following example:</P>

<PRE>
    int c;

    struct A {
       A() { ++c; }
       A(const A&amp;) { ++c; }
    };

    struct B {
       A a;
       B(const A&amp; a): a(a) { }
    };

    int main() {
       (B(A()));
       return c - 1;
    }
</PRE>

<P>Here we would like to be able to avoid the copy and just
construct the <TT>A()</TT> directly into the <TT>A</TT> subobject
of <TT>B</TT>.  But we can't, because it isn't allowed by
12.8 [class.copy] paragraph 34 bullet 3:</P>

<UL><LI><P>when a temporary class object that has not been bound
to a reference (12.2 [class.temporary]) would be copied/moved
to a class object with the same cv-unqualified type, the
copy/move operation can be omitted by constructing the temporary
object directly into the target of the omitted
copy/move</P></LI></UL>

<P>The part about not being bound to a reference was added for an
unrelated reason by <A HREF="
     cwg_defects.html#185">issue 185</A>.  If
that resolution were recast to require that the temporary object
is not accessed after the copy, rather than banning the reference
binding, this optimization could be applied.</P>

<P>The similar example using pass by value is also not one of the
allowed cases, which could be considered part of <A HREF="
     cwg_active.html#6">issue 6</A>.
</P>

<BR><BR><HR><A NAME="1928"></A><H4>1928.
  
Triviality of deleted special member functions
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-15<BR>




<P>The current wording of the Standard does not make clear whether
a special member function that is defaulted and implicitly deleted is
trivial.  Triviality is visible in various ways that don't involve
invoking the function, such as determining whether a type is
trivially copyable and determining the result of various type traits.
It also factors into some ABI specifications.</P>

<P>(See also <A HREF="
     cwg_active.html#1734">issue 1734</A>.)</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG felt that deleted functions should be trivial.  See also
<A HREF="
     cwg_active.html#1590">issue 1590</A>.  </P>

<P><B>Additional note, November, 2014:</B></P>

<P>See paper N4148.</P>

<BR><BR><HR><A NAME="1991"></A><H4>1991.
  
Inheriting constructors vs default arguments
</H4><B>Section: </B>12.9&#160; [class.inhctor]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-27<BR>




<P>The creation of inheriting constructors does not, but should,
consider the default arguments of constructors in the inheriting
class.  For example,</P>

<PRE>
  struct A {
    A(int, int);
  };

  struct B : A {
    using A::A;
    B(int, int, int = 0); //<SPAN style="font-family:Times;font-style:italic"> does not suppress creation of </SPAN>B(int, int)<SPAN style="font-family:Times;font-style:italic"> from </SPAN>A(int, int)
  };
</PRE>

<BR><BR><HR><A NAME="545"></A><H4>545.
  
User-defined conversions and built-in operator overload resolution
</H4><B>Section: </B>13.3.1.2&#160; [over.match.oper]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>31 October 2005<BR>




<P>Consider the following example:</P>

<PRE>
    class B1 {};
    typedef void (B1::*PB1) (); //<SPAN style="font-family:Times;font-style:italic"> memptr to </SPAN>B1

    class B2 {};
    typedef void (B2::*PB2) (); //<SPAN style="font-family:Times;font-style:italic"> memptr to </SPAN>B2

    class D1 : public B1, public B2 {};
    typedef void (D1::*PD) (); //<SPAN style="font-family:Times;font-style:italic"> memptr to </SPAN>D1

    struct S {
         operator PB1(); //<SPAN style="font-family:Times;font-style:italic"> can be converted to </SPAN>PD
    } s;
    struct T {
         operator PB2(); //<SPAN style="font-family:Times;font-style:italic"> can be converted to </SPAN>PD
    } t;

    void foo() {
         s == t; //<SPAN style="font-family:Times;font-style:italic"> Is this an error?</SPAN>
    }
</PRE>

<P>According to 13.6 [over.built] paragraph 16, there is an
<TT>operator==</TT> for <TT>PD</TT> (&#8220;For every pointer to
member type...&#8221;), so why wouldn't it be used for this
comparison?</P>

<P><U>Mike Miller</U>: The problem, as I understand it, is that
13.3.1.2 [over.match.oper] paragraph 3, bullet 3, sub-bullet 3
is broader than it was intended to be.  It says that candidate
built-in operators must &#8220;accept operand types to which the given
operand or operands can be converted according to 13.3.3.1 [over.best.ics].&#8221; 13.3.3.1.2 [over.ics.user]
describes user-defined conversions as having a second standard
conversion sequence, and there is nothing to restrict that second
standard conversion sequence.</P>

<P>My initial thought on addressing this would be to say that
user-defined conversion sequences whose second standard conversion
sequence contains a pointer conversion or a pointer-to-member
conversion are not considered when selecting built-in candidate
operator functions.  They would still be applicable after the hand-off
to Clause 5 (e.g., in bringing the operands to their common type,
5.10 [expr.eq], or composite pointer type, 5.9 [expr.rel]), just not in constructing the list of built-in
candidate operator functions.</P>

<P>I started to suggest restricting the second standard conversion
sequence to conversions having Promotion or Exact Match rank, but that
would exclude the Boolean conversions, which are needed
for <TT>!</TT>, <TT>&amp;&amp;</TT>, and <TT>||</TT>.  (It would have
also restricted the floating-integral conversions, though, which might
be a good idea.  They can't be used implicitly, I think, because there
would be an ambiguity among all the promoted integral types; however,
none of the compilers I tested even tried those conversions because
the errors I got were not ambiguities but things like &#8220;floating
point operands not allowed for <TT>%</TT>&#8221;.)</P>

<P><U>Bill Gibbons</U>: I recall seeing this problem before, though
possibly not in committee discussions.  As written this rule makes the
set of candidate functions dependent on what classes have been
defined, including classes not otherwise required to have been defined
in order for "==" to be meaningful.  For templates this implies that
the set is dependent on what templates have been instantiated,
e.g.</P>

<PRE>
  template&lt;class T&gt; class U : public T { };
  U&lt;B1&gt; u;  //<SPAN style="font-family:Times;font-style:italic"> changes the set of candidate functions to include</SPAN>
            //<SPAN style="font-family:Times;font-style:italic"> </SPAN>operator==(U&lt;B1&gt;,U&lt;B1&gt;)<SPAN style="font-family:Times;font-style:italic">?</SPAN>
</PRE>

<P>There may be other places where the existence of a class
definition, or worse, a template instantiation, changes the semantics
of an otherwise valid program (e.g. pointer conversions?) but it seems
like something to be avoided.</P>

<P>(See also <A HREF="
     cwg_active.html#954">issue 954</A>.)</P>

<BR><BR><HR><A NAME="1919"></A><H4>1919.
  
Overload resolution for <TT>!</TT> with explicit conversion operator
</H4><B>Section: </B>13.3.1.2&#160; [over.match.oper]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-30<BR>




<P>Although the intent is that the <TT>!</TT> operator should be
usable with an operand that is a class object having an explicit
conversion to <TT>bool</TT> (i.e., its operand is
&#8220;contextually converted to <TT>bool</TT>&#8221;), the
selection of the conversion operator is done via
13.3.1.2 [over.match.oper], 13.3.2 [over.match.viable], and
13.3.3 [over.match.best], which do not make specific allowance
for this special characteristic of the <TT>!</TT> operator and
thus will not select the explicit conversion function.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG noted that this same issue affects <TT>&amp;&amp;</TT>
and <TT>||</TT>.</P>

<BR><BR><HR><A NAME="1781"></A><H4>1781.
  
Converting from <TT>nullptr_t</TT> to <TT>bool</TT> in overload resolution
</H4><B>Section: </B>13.3.1.5&#160; [over.match.conv]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-26<BR>


<P>According to 13.3.1.5 [over.match.conv] paragraph 1, when a class
type <TT>S</TT> is used as an initializer for an object of type <TT>T</TT>,
</P>

<BLOCKQUOTE>

The conversion functions of <TT>S</TT> and its base classes are
considered. Those non-explicit conversion functions that are not hidden
within <TT>S</TT> and yield type <TT>T</TT> or a type that can be converted
to type <TT>T</TT> via a standard conversion sequence
(13.3.3.1.1 [over.ics.scs]) are candidate functions.

</BLOCKQUOTE>

<P>Because conversion from <TT>std::nullptr_t</TT> to <TT>bool</TT>
is only permitted in direct-initialization (4.12 [conv.bool]),
it is not clear whether there is a standard conversion sequence from
<TT>std::nullptr_t</TT> to <TT>bool</TT>, considering that an
implicit conversion sequence is intended to model
copy-initialization.  Should 13.3.1.5 [over.match.conv] be
understood to refer only to conversions permitted in
copy-initialization, or should the form of the initialization be
considered?  For example,</P>

<PRE>
  struct SomeType {
    operator std::nullptr_t();
  };
  bool b{ SomeType() };    //<SPAN style="font-family:Times;font-style:italic"> Well-formed?</SPAN>
</PRE>

<P>Note also 13.3.3.2 [over.ics.rank] paragraph 4, which may bear
on the intent (or, alternatively, might describe a situation that
cannot arise):</P>

<BLOCKQUOTE>

A conversion that does not convert a pointer, a pointer to member, or
<TT>std::nullptr_t</TT> to <TT>bool</TT> is better than one that does.

</BLOCKQUOTE>

<BR><BR><HR><A NAME="418"></A><H4>418.
  
Imperfect wording on error on multiple default arguments on a called function
</H4><B>Section: </B>13.3.3&#160; [over.match.best]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Chris Bowler
 &#160;&#160;&#160;

 <B>Date: </B>27 May 2003<BR>




<P>According to
13.3.3 [over.match.best] paragraph 4, the following program
appears to be ill-formed:</P>
<PRE>
  void f(int, int=0);
  void f(int=0, int);

  void g() {
    f();
  }
</PRE>
<P>Though I do not expect this is the intent of this paragraph in the
standard.</P>

<P>13.3.3 [over.match.best] paragraph 4:</P>
<BLOCKQUOTE>
If the best viable function resolves to a function for which multiple
declarations were found, and if at least
two of these declarations or the declarations they refer to in the case of
using-declarations specify a
default argument that made the function viable, the program is ill-formed.
[Example:
<PRE>
namespace A {
  extern "C" void f(int = 5);
}
namespace B {
  extern "C" void f(int = 5);
}
using A::f;
using B::f;
void use() {
f(3); //OK, default argument was not used for viability
f(); //Error: found default argument twice
}
</PRE>
end example]</BLOCKQUOTE>

<BR><BR><HR><A NAME="1459"></A><H4>1459.
  
Reference-binding tiebreakers in overload resolution
</H4><B>Section: </B>13.3.3.2&#160; [over.ics.rank]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2012-02-07<BR>


<P>Both paragraph 3 and paragraph 4 of 13.3.3.2 [over.ics.rank] have
overload resolution tiebreakers for reference binding.  It might be
possible to merge those into a single treatment.</P>

<BR><BR><HR><A NAME="1038"></A><H4>1038.
  
Overload resolution of <TT>&amp;x.static_func</TT>
</H4><B>Section: </B>13.4&#160; [over.over]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2010-03-02<BR>


<P>The Standard is not clear whether the following example is
well-formed or not:</P>

<PRE>
    struct S {
        static void f(int);
        static void f(double);
    };
    S s;
    void (*pf)(int) = &amp;s.f;
</PRE>

<P>According to 5.2.5 [expr.ref] paragraph 4 bullet 3,
you do function overload resolution to determine whether
<TT>x.f</TT> is a static or non-static member function.
5.3.1 [expr.unary.op] paragraph 6 says that you can only
take the address of an overloaded function in a context that
determines the overload to be chosen, and the initialization of a
function pointer is such a context (13.4 [over.over]
paragraph 1).  The problem is that 13.4 [over.over] is
phrased in terms of &#8220;an overloaded function name,&#8221;
and this is a member access expression, not a name.</P>

<P>There is variability among implementations as to whether this
example is accepted; some accept it as written, some only if the
<TT>&amp;</TT> is omitted, and some reject it in both forms.</P>

<P><B>Additional note (October, 2010):</B></P>

<P>A related question concerns an example like</P>

<PRE>
    struct S {
        static void g(int*) {}
        static void g(long) {}
    } s;

    void foo() {
        (&amp;s.g)(0L);
    }
</PRE>

<P>Because the address occurs in a call context and not in one of
the contexts mentioned in 13.4 [over.over] paragraph 1,
the call expression in <TT>foo</TT> is presumably ill-formed.
Contrast this with the similar example</P>

<PRE>
    void g1(int*) {}
    void g1(long) {}

    void foo1() {
        (&amp;g1)(0L);
    }
</PRE>

<P>This call presumably is well-formed because 13.3.1.1 [over.match.call] applies to &#8220;the address of a set of overloaded
functions.&#8221; (This was clearer in the wording prior to the
resolution of <A HREF="
     cwg_defects.html#704">issue 704</A>: &#8220;...in
this context using <TT>&amp;F</TT> behaves the same as using the
name <TT>F</TT> by itself.&#8221;) It's not clear that there's any
reason to treat these two cases differently.</P>

<P>This question also bears on the original question of this issue,
since the original wording of 13.3.1.1 [over.match.call] also
described the case of an ordinary member function call like
<TT>s.g(0L)</TT> as involving the &#8220;name&#8221; of the function,
even though the <I>postfix-expression</I> is a member access
expression and not a &#8220;name.&#8221; Perhaps the reference to
&#8220;name&#8221; in 13.4 [over.over] should be similarly
understood as applying to member access expressions?</P>



<BR><BR><HR><A NAME="1549"></A><H4>1549.
  
Overloaded comma operator with <TT>void</TT> operand
</H4><B>Section: </B>13.5.2&#160; [over.binary]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2012-09-04<BR>




<P>Even though a function cannot take a parameter of type <TT>void</TT>,
the current rules for overload resolution require consideration of
overloaded operators when one operand has a user-defined or enumeration
type and the other has type <TT>void</TT>.  This can result in side
effects and possibly errors, for example:</P>

<PRE>
  template &lt;class T&gt; struct A {
    T t;
    typedef T type;
  };

  struct X {
    typedef A&lt;void&gt; type;
  };

  template &lt;class T&gt; void operator ,(typename T::type::type, T) {}

  int main() {
    X(), void(); //<SPAN style="font-family:Times;font-style:italic"> OK</SPAN>
    void(), X(); //<SPAN style="font-family:Times;font-style:italic"> error: </SPAN>A&lt;void&gt;<SPAN style="font-family:Times;font-style:italic"> is instantiated with a field of</SPAN>
                 //<SPAN style="font-family:Times;font-style:italic"> type </SPAN>void
  }
</PRE>



<BR><BR><HR><A NAME="1620"></A><H4>1620.
  
User-defined literals and extended integer types
</H4><B>Section: </B>13.5.8&#160; [over.literal]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-12<BR>




<P>Although numeric literals can have extended integer types,
user-defined literal operators cannot have a parameter of an
extended integer type.  This seems like an oversight.</P>

<BR><BR><HR><A NAME="260"></A><H4>260.
  
User-defined conversions and built-in <TT>operator=</TT>
</H4><B>Section: </B>13.6&#160; [over.built]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Scott Douglas
 &#160;&#160;&#160;

 <B>Date: </B>4 Nov 2000<BR>


<P>According to the Standard (although not implemented this way
in most implementations), the following code exhibits non-intuitive
behavior:</P>

<PRE>
  struct T {
    operator short() const;
    operator int() const;
  };

  short s;

  void f(const T&amp; t) {
    s = t;  // surprisingly calls T::operator int() const
  }
</PRE>

<P>The reason for this choice is 13.6 [over.built]
paragraph 18:</P>

<BLOCKQUOTE>

<P>For every triple (<I>L</I>, <I>VQ</I>, <I>R</I>), where <I>L</I> is an
arithmetic type, <I>VQ</I> is either <TT>volatile</TT> or empty, and
<I>R</I> is a promoted arithmetic type, there exist candidate operator
functions of the form</P> 

<UL><I>VQ</I> <I>L</I><TT>&amp; operator=(</TT><I>VQ L</I><TT>&amp;,</TT> <I>R</I><TT>);</TT></UL>

</BLOCKQUOTE>

<P>Because <I>R</I> is a "promoted arithmetic type," the second argument
to the built-in assignment operator is <TT>int</TT>, causing the
unexpected choice of conversion function.</P>

<P><B>Suggested resolution:</B> Provide built-in assignment operators
for the unpromoted arithmetic types.</P>

<P>Related to the preceding, but not resolved by the suggested
resolution, is the following problem.  Given:</P>

<PRE>
    struct T {
	 operator int() const;
	 operator double() const;
    };
</PRE>

<P>I believe the standard requires the following assignment to be
ambiguous (even though I expect that would surprise the user):</P>

<PRE>
    double x;
    void f(const T&amp; t) { x = t; }
</PRE>

<P>The problem is that both of these built-in <TT>operator=()</TT>s exist
(13.6 [over.built] paragraph 18):</P>

<PRE>
    double&amp; operator=(double&amp;, int);
    double&amp; operator=(double&amp;, double);
</PRE>

<P>Both are an exact match on the first argument and a user conversion
on the second.  There is no rule that says one is a better match than
the other.</P>

<P>The compilers that I have tried (even in their strictest setting)
do not give a peep.  I think they are not following the standard.
They pick <TT>double&amp; operator=(double&amp;, double)</TT> and use
<TT>T::operator double() const</TT>.</P>

<P>I hesitate to suggest changes to overload resolution, but a
possible resolution might be to introduce a rule that, for built-in
<TT>operator=</TT> only, also considers the conversion sequence from
the second to the first type.  This would also resolve the earlier
question.</P>

<P>It would still leave <TT>x += t</TT> etc. ambiguous -- which might
be the desired behavior and is the current behavior of some
compilers.</P>

<P><B>Notes from the 04/01 meeting:</B></P>

<P>The difference between initialization and assignment is
disturbing.  On the other hand, promotion is ubiquitous in the
language, and this is the beginning of a very slippery slope (as
the second report above demonstrates).
</P>

<P><B>Additional note (August, 2010):</B></P>

<P>See <A HREF="
     cwg_closed.html#507">issue 507</A> for a similar example
involving comparison operators.</P>

<BR><BR><HR><A NAME="954"></A><H4>954.
  
Overload resolution of conversion operator templates with built-in types
</H4><B>Section: </B>13.6&#160; [over.built]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Clamage
 &#160;&#160;&#160;

 <B>Date: </B>19 August, 2009<BR>


<P>Consider the following example:</P>

<PRE>
    struct NullClass {
        template&lt;typename T&gt; operator T () { return 0 ; }
    };

    int main() {
        NullClass n;
        n==5;        // #1
        return 0;
    }
</PRE>

<P>The comparison at #1 is, according to the current Standard,
ambiguous.  According to 13.6 [over.built] paragraph 12, the
candidates for <TT>operator==(L, R)</TT> include functions &#8220;for
every pair of promoted arithmetic types,&#8221; so <TT>L</TT> could be
either <TT>int</TT> or <TT>long</TT>, and the conversion operator
template will provide an exact match for either.</P>

<P>Some implementations unambiguously choose the <TT>int</TT> candidate.
Perhaps the overload resolution rules could be tweaked to prefer
candidates in which <TT>L</TT> and <TT>R</TT> are the same type?</P>

<P>(See also <A HREF="
     cwg_active.html#545">issue 545</A>.)</P>

<BR><BR><HR><A NAME="110"></A><H4>110.
  
Can template functions and classes be declared in the same scope?
</H4><B>Section: </B>14&#160; [temp]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>28 Apr 1999<BR>




<P>According to 14 [temp]
 paragraph 5,</P>
<BLOCKQUOTE>

Except that a function template can be overloaded either by
(non-template) functions with the same name or by other function
templates with the same name
(14.8.3 [temp.over]
), a template name declared
in namespace scope or in class scope shall be unique in that scope.

</BLOCKQUOTE>
3.3.10 [basic.scope.hiding]
 paragraph 2 agrees
that only functions, not function templates, can hide a class name
declared in the same scope:
<BLOCKQUOTE>

A class name (9.1 [class.name]
) or
enumeration name (7.2 [dcl.enum]
) can be
hidden by the name of an object, function, or enumerator declared in
the same scope.

</BLOCKQUOTE>
However, 3.3 [basic.scope]
 paragraph 4
treats functions and template functions together in this regard:
<BLOCKQUOTE>

Given a set of declarations in a single declarative region, each of
which specifies the same unqualified name,

<UL>
<LI>they shall all refer to the same entity, or all refer to functions
and function templates; or</LI>

<LI>exactly one declaration shall declare a class name or enumeration
name that is not a typedef name and the other declarations shall all
refer to the same object or enumerator, or all refer to functions and
function templates; in this case the class name or enumeration name is
hidden</LI>

</UL>
</BLOCKQUOTE>

<P><B>John Spicer:</B> You should be able to take an existing program
and replace an existing function with a function template without
breaking unrelated parts of the program.

In addition, all of the compilers I tried allow this usage (EDG, Sun,
egcs, Watcom, Microsoft, Borland).

I would recommend that function templates be handled exactly like functions
for purposes of name hiding.</P>

<P><B>Martin O'Riordan:</B> I don't see any justification for extending
the purview of what is decidedly a hack, just for the sake of consistency.
In fact, I think we should go further and in the interest of consistency, we
should deprecate the hack, scheduling its eventual removal from the C++
language standard.</P>

<P>The hack is there to allow old C programs and especially the
'stat.h' file to compile with minimum effort (also several other Posix and X
headers).  People changing such older programs have ample opportunity to "do
it right".  Indeed, if you are adding templates to an existing program, you
should probably be placing your templates in a 'namespace', so the issue
disappears anyway.  The lookup rules should be able to provide the behaviour
you need without further hacking.</P>
<BR><BR><HR><A NAME="2032"></A><H4>2032.
  
Default <I>template-argument</I>s of variable templates
</H4><B>Section: </B>14.1&#160; [temp.param]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2014-11-03<BR>


<P>According to 14.1 [temp.param] paragraph11,</P>

<BLOCKQUOTE>

If a <I>template-parameter</I> of a class template or alias
template has a default <I>template-argument</I>, each
subsequent <I>template-parameter</I> shall either have a
default <I>template-argument</I> supplied or be a template
parameter pack. If a <I>template-parameter</I> of a primary
class template or alias template is a template parameter
pack, it shall be the last <I>template-parameter</I>.

</BLOCKQUOTE>

<P>These requirements should apply to variable templates as well.</P>

<BR><BR><HR><A NAME="579"></A><H4>579.
  
What is a &#8220;nested&#8221; <TT>&gt;</TT> or <TT>&gt;&gt;</TT>?
</H4><B>Section: </B>14.2&#160; [temp.names]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>11 May 2006<BR>


<P>The Standard does not normatively define which <TT>&gt;</TT> and
<TT>&gt;&gt;</TT> tokens are to be taken as closing a
<I>template-argument-list</I>; instead, 14.2 [temp.names]
paragraph 3 uses the undefined and imprecise term
&#8220;non-nested:&#8221;</P>

<BLOCKQUOTE>

When parsing a <I>template-id</I>, the first non-nested <TT>&gt;</TT>
is taken as the end of the <I>template-argument-list</I> rather than a
greater-than operator.  Similarly, the first
non-nested <TT>&gt;&gt;</TT> is treated as two consecutive but
distinct <TT>&gt;</TT> tokens, the first of which is taken as the end
of the <I>template-argument-list</I> and completes the <I>template-id</I>.

</BLOCKQUOTE>

<P>The (non-normative) footnote clarifies that</P>

<BLOCKQUOTE>

A <TT>&gt;</TT> that encloses the <I>type-id</I> of a <TT>dynamic_cast</TT>, <TT>static_cast</TT>,
<TT>reinterpret_cast</TT> or <TT>const_cast</TT>, or which encloses the
<I>template-argument</I>s of a subsequent <I>template-id</I>, is
considered nested for the purpose of this description.

</BLOCKQUOTE>

<P>Aside from the questionable wording of this footnote (e.g., in what
sense does a single terminating character &#8220;enclose&#8221;
anything, and is a nested <I>template-id</I>
&#8220;subsequent?&#8221;) and the fact that it is non-normative, it
does not provide a complete definition of what &#8220;nesting&#8221;
is intended to mean.  For example, is the first <TT>&gt;</TT> in this
putative <I>template-id</I> &#8220;nested&#8221; or not?</P>

<PRE>
    X&lt;a ? b &gt; c : d&gt;
</PRE>

<P><B>Additional note (January, 2014):</B></P>

<P>A similar problem exists for an <TT>operator&gt;</TT> template:</P>

<PRE>
  struct S;
  template&lt;void (*)(S, S)&gt; struct X {};
  void operator&gt;(S, S);
  X&lt;operator&gt; &gt; x;
</PRE>

<P>Somehow the specification must be written to avoid taking the
<TT>&gt;</TT> token in the operator name as the end of the template
argument list for <TT>X</TT>.</P>

<BR><BR><HR><A NAME="440"></A><H4>440.
  
Allow implicit pointer-to-member conversion on nontype template argument
</H4><B>Section: </B>14.3&#160; [temp.arg]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>David Abrahams
 &#160;&#160;&#160;

 <B>Date: </B>13 Nov 2003<BR>


<P>None of my compilers accept this, which surprised me a little.  Is
the base-to-derived member function conversion considered to be a
runtime-only thing?</P>
<PRE>
  template &lt;class D&gt;
  struct B
  {
      template &lt;class X&gt; void f(X) {}
      template &lt;class X, void (D::*)(X) = &amp;B&lt;D&gt;::f&lt;X&gt; &gt;
      struct row {};
  };
  struct D : B&lt;D&gt;
  {
      void g(int);
      row&lt;int,&amp;D::g&gt; r1;
      row&lt;char*&gt; r2;
  };
</PRE>
<P><U>John Spicer</U>:
This is not among the permitted conversions listed in 14.3.</P>

<P>I'm not sure there is a terribly good reason for that.  Some of the
template argument rules for external entities were made conservatively
because of concerns about issues of mangling template argument names.</P>

<P><U>David Abrahams</U>:
I'd really like to see that restriction loosened.  It is a serious
inconvenience because there appears to be no way to supply a usable
default in this case.  Zero would be an OK default if I could use the
function pointer's equality to zero as a compile-time switch to
choose an empty function implementation:</P>
<PRE>
  template &lt;bool x&gt; struct tag {};

  template &lt;class D&gt;
  struct B
  {
      template &lt;class X&gt; void f(X) {}

      template &lt;class X, void (D::*pmf)(X) = 0 &gt;
      struct row {
          void h() { h(tag&lt;(pmf == 0)&gt;(), pmf); }
          void h(tag&lt;1&gt;, ...) {}
          void h(tag&lt;0&gt;, void (D::*q)(X)) { /*something*/}
      };
  };

  struct D : B&lt;D&gt;
  {
      void g(int);
      row&lt;int,&amp;D::g&gt; r1;
      row&lt;char*&gt; r2;
  };
</PRE>

<P>But there appears to be no way to get that effect either.  The result
is that you end up doing something like:</P>
<PRE>
      template &lt;class X, void (D::*pmf)(X) = 0 &gt;
      struct row {
          void h() { if (pmf) /*something*/ }
      };
</PRE>

<P>which invariably makes compilers warn that you're switching on a
constant expression.</P>

<BR><BR><HR><A NAME="150"></A><H4>150.
  
Template template parameters and default arguments
</H4><B>Section: </B>14.3.3&#160; [temp.arg.template]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>3 Aug 1999<BR>



<P>[Picked up by evolution group at October 2002 meeting.]</P>



<P>How are default template arguments handled with respect to template
template parameters?  Two separate questions have been raised:</P>

<OL>
<LI>
Do default template arguments allow a template argument to match a
template parameter with fewer template parameters, and can the
template template parameter be specialized using the smaller number of
template arguments?  For example,

<PRE>
    template &lt;class T, class U = int&gt;
    class ARG { };

    template &lt;class X, template &lt;class Y&gt; class PARM&gt;
    void f(PARM&lt;X&gt;) { }    // specialization permitted?

    void g() {
        ARG&lt;int&gt; x;        // actually ARG&lt;int, int&gt;
        f(x);              // does ARG (2 parms, 1 with default)
                           // match PARM (1 parm)?
</PRE>

Template template parameters are deducible
(14.8.2.5 [temp.deduct.type]
 paragraph 9),
but 14.3.3 [temp.arg.template]
 does not
specify how matching is done.

<P><U>Jack Rouse</U>:
I implemented template template parameters assuming template signature
matching is analogous to function type matching.  This seems like the
minimum reasonable implementation.  The code in the example would not
be accepted by this compiler.  However, template default arguments are
compile time entities so it seems reasonable to relax the matching
rules to allow cases like the one in the example.  But I would
consider this to be an extension to the language.</P>

<P><U>Herb Sutter</U>:
An open issue in the LWG is that the standard
doesn't explicitly permit or forbid implementations' adding additional
<I>template-parameter</I>s
to those specified by the standard, and the LWG may be
leaning toward explicitly permitting this. 
[Under this interpretation,]
if the standard is ever modified to allow additional
<I>template-parameter</I>s,
then writing "a template that takes a standard library template as a
template template parameter" won't be just ugly because you have to mention
the defaulted parameters; it would not be (portably) possible at all except
possibly by defining entire families of overloaded templates to account for
all the possible numbers of parameters
<TT>vector&lt;&gt;</TT> (or anything else) might
actually have. That seems unfortunate.</P></LI>

<LI>
Are default arguments permitted in the template parameter list of a
template template parameter?  For example,

<PRE>
    template &lt;template &lt;class T, class U = int&gt; class PARM&gt;
    class C {
        PARM&lt;int&gt; pi;
    };
</PRE>

<P><U>Jack Rouse</U>:
I decided they could not in the compiler I support.  This continues
the analogy with function type matching.  Also, I did not see a strong
need to allow default arguments in this context.</P>

<P>A class template used as a template template argument can have default
template arguments from its declarations.  How are the two sources of
default arguments to be reconciled?  The default arguments from the
template template formal could override.  But it could be cofusing if
a <I>template-id</I> using the argument template, <TT>ARG&lt;int&gt;</TT>, behaves
differently from a <I>template-id</I> using the template formal name,
<TT>FORMAL&lt;int&gt;</TT>.</P></LI>

</OL>

<P><B>Rationale (10/99):</B> Template template parameters are intended
to be handled analogously to function function parameters.  Thus the
number of parameters in a template template argument must match the
number of parameters in a template template parameter, regardless of
whether any of those paramaters have default arguments or not.  Default
arguments are allowed for the parameters of a template template
parameter, and those default arguments alone will be considered in
a specialization of the template template parameter within a template
definition; any default arguments for the parameters of a template
template argument are ignored.</P>

<P><B>Note (Mark Mitchell, February, 2006):</B></P>

<P>Perhaps it is already obvious to all, but it seems worth noting that
this extension would change the meaning of conforming programs:</P>

<PRE>
    struct Dense { static const unsigned int dim = 1; };

    template &lt;template &lt;typename&gt; class View,
              typename Block&gt;
    void operator+(float, View&lt;Block&gt; const&amp;);

    template &lt;typename Block,
              unsigned int Dim = Block::dim&gt;
    struct Lvalue_proxy { operator float() const; };

    void test_1d (void) {
        Lvalue_proxy&lt;Dense&gt; p;
        float b;
        b + p;
    }
</PRE>

<P>If <TT>Lvalue_proxy</TT> is allowed to bind to <TT>View</TT>, then the
template <TT>operator+</TT> will be used to perform addition; otherwise,
<TT>Lvalue_proxy</TT>'s implicit conversion to float, followed by the
built-in addition on floats will be used.</P>

<P><B>Note (March, 2008):</B></P>

<P>The Evolution Working Group has accepted the intent of this issue
and referred it to CWG for action (not for C++0x).  See paper
J16/07-0033 = WG21 N2173.</P>

<P><B>Notes from the June, 2008 meeting:</B></P>

<P>The CWG decided to take no action on this issue until an interested
party produces a paper with analysis and a proposal.</P>
<BR><BR><HR><A NAME="1918"></A><H4>1918.
  
<TT>friend</TT> templates with dependent scopes
</H4><B>Section: </B>14.5.4&#160; [temp.friend]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-04-27<BR>




<P>It is not clear what should happen for an example like:</P>

<PRE>
  template&lt;typename T&gt; struct A {
    class B {
      class C {};
    };
  };
  class X {
    static int x;
    template &lt;typename T&gt; friend class A&lt;T&gt;::B::C;
  };
  template&lt;&gt; struct A&lt;int&gt; {
    typedef struct Q B;
  };
  struct Q {
    class C {
      int f() { return X::x; }
    };
  };
</PRE>

<P>It appears that the friend template matches <TT>Q::C</TT>, because that
class is also <TT>A&lt;int&gt;::B::C</TT>, but neither GCC nor EDG allow
this code (saying <TT>X::x</TT> is inaccessible). (Clang doesn't support
friend template declarations with a dependent scope.)</P>

<P>A strict reading of 14.5.4 [temp.friend] paragraph 5 might
suggest that the friend declaration itself is ill-formed, because it does
not declare a member of a class template, but I can't find any compiler
that implements template friends that way.</P>

<BR><BR><HR><A NAME="1945"></A><H4>1945.
  
Friend declarations naming members of class templates in non-templates
</H4><B>Section: </B>14.5.4&#160; [temp.friend]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-19<BR>


<P>During the discussion of <A HREF="
     cwg_active.html#1918">issue 1918</A>, it
was decided that the last part of the issue should be split off into a
separate issue.  According to 14.5.4 [temp.friend] paragraph 5,</P>

<BLOCKQUOTE>

A member of a class template may be declared to be a friend of a
non-template class.

</BLOCKQUOTE>

<P>Does this make the example from <A HREF="
     cwg_active.html#1918">issue 1918</A>,</P>

<PRE>
  template&lt;typename T&gt; struct A {
    class B {
      class C {};
    };
  };
  class X {
    static int x;
    template &lt;typename T&gt; friend class A&lt;T&gt;::B::C;
  };
  template&lt;&gt; struct A&lt;int&gt; {
    typedef struct Q B;
  };
  struct Q {
    class C {
      int f() { return X::x; }
    };
  };
</PRE>

<P>ill-formed because the friend declaration does not refer to a
member of a class template?  This does not appear to be the
interpretation chosen by most implementations.</P>

<BR><BR><HR><A NAME="708"></A><H4>708.
  
Partial specialization of member templates of class templates
</H4><B>Section: </B>14.5.5&#160; [temp.class.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>8 Aug, 2008<BR>




<P>The Standard does not appear to specify clearly the effect of a
partial specialization of a member template of a class template.
For example:</P>

<PRE>
    template&lt;class T&gt; struct B {
         template&lt;class U&gt; struct A { // #1
             void h() {}
         };
         template&lt;class U&gt; struct A&lt;U*&gt; {  // #2
             void f() {}
         };
    };

    template&lt;&gt; template&lt;class U&gt; struct B&lt;int&gt;::A { // #3
         void g() {}
    };

    void q(B&lt;int&gt;::A&lt;char*&gt;&amp; p) {
         p.f();  // #4
    }
</PRE>

<P>The explicit specialization at #3 replaces the primary member
template #1 of <TT>B&lt;int&gt;</TT>; however, it is not clear
whether the partial specialization #2 should be considered to
apply to the explicitly-specialized member template of
<TT>A&lt;int&gt;</TT> (thus allowing the call to <TT>p.f()</TT>
at #4) or whether the partial specialization will be used only
for specializations of <TT>B</TT> that are implicitly
instantiated (meaning that #4 could call <TT>p.g()</TT> but not
<TT>p.f()</TT>).</P>

<BR><BR><HR><A NAME="2033"></A><H4>2033.
  
Redundant restriction on partial specialization argument
</H4><B>Section: </B>14.5.5&#160; [temp.class.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2014-11-04<BR>


<P>Bullets 8.3 and 8.4 of 14.5.5 [temp.class.spec] say,</P>

<BLOCKQUOTE>

<P>Within the argument list of a class template partial
specialization, the following restrictions apply:</P>

<UL><LI><P>...</P></LI>

<LI><P>The argument list of the specialization shall not be
identical to the implicit argument list of the primary
template.</P></LI>

<LI><P>The specialization shall be more specialized than the
primary template (14.5.5.2 [temp.class.order]).</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>The former is implied by the latter and should be
omitted.</P>

<BR><BR><HR><A NAME="2035"></A><H4>2035.
  
Multi-section example is confusing
</H4><B>Section: </B>14.5.5.1&#160; [temp.class.spec.match]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2014-11-06<BR>


<P>The example in 14.5.5.1 [temp.class.spec.match] paragraph 2 reads,</P>

<PRE>
  A&lt;int, int, 1&gt;   a1;   //<SPAN style="font-family:Times;font-style:italic"> uses #1</SPAN>
  A&lt;int, int*, 1&gt;  a2;   //<SPAN style="font-family:Times;font-style:italic"> uses #2, </SPAN>T<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int<SPAN style="font-family:Times;font-style:italic">, </SPAN>I<SPAN style="font-family:Times;font-style:italic"> is </SPAN>1
  A&lt;int, char*, 5&gt; a3;   //<SPAN style="font-family:Times;font-style:italic"> uses #4, </SPAN>T<SPAN style="font-family:Times;font-style:italic"> is </SPAN>char
  A&lt;int, char*, 1&gt; a4;   //<SPAN style="font-family:Times;font-style:italic"> uses #5, </SPAN>T1<SPAN style="font-family:Times;font-style:italic"> is </SPAN>int<SPAN style="font-family:Times;font-style:italic">, </SPAN>T2<SPAN style="font-family:Times;font-style:italic"> is </SPAN>char<SPAN style="font-family:Times;font-style:italic">, </SPAN>I<SPAN style="font-family:Times;font-style:italic"> is </SPAN>1
  A&lt;int*, int*, 2&gt; a5;   //<SPAN style="font-family:Times;font-style:italic"> ambiguous: matches #3 and #5</SPAN>
</PRE>

<P>However, the referenced numbers are defined two pages earlier,
in 14.5.5 [temp.class.spec] paragraph 3.  This is confusing and
should be changed.</P>

<BR><BR><HR><A NAME="310"></A><H4>310.
  
Can function templates differing only in parameter cv-qualifiers be overloaded?
</H4><B>Section: </B>14.5.6.1&#160; [temp.over.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Andrei Iltchenko
 &#160;&#160;&#160;

 <B>Date: </B>29 Aug 2001<BR>


<P>I get the following error diagnostic [from the EDG front end]:
<PRE>
line 8: error: function template "example&lt;T&gt;::foo&lt;R,A&gt;(A)" has
          already been declared
     R  foo(const A);
        ^
</PRE>
when compiling this piece of code:
<PRE>
struct  example  {
   template&lt;class R, class A&gt;   // 1-st member template
   R  foo(A);
   template&lt;class R, class A&gt;   // 2-nd member template
   const R  foo(A&amp;);
   template&lt;class R, class A&gt;   // 3-d  member template
   R  foo(const A);
};

/*template&lt;&gt; template&lt;&gt;
int  example&lt;char&gt;::foo(int&amp;);*/


int  main()
{
   int  (example&lt;char&gt;::* pf)(int&amp;) =
      &amp;example&lt;char&gt;::foo;
}
</PRE>
</P>

<P>The implementation complains that
<PRE>
   template&lt;class R, class A&gt;   // 1-st member template
   R  foo(A);
   template&lt;class R, class A&gt;   // 3-d  member template
   R  foo(const A);
</PRE>
cannot be overloaded and I don't see any reason for it
since it is function template specializations that are
treated like ordinary non-template functions, meaning
that the transformation of a
parameter-declaration-clause into the corresponding
parameter-type-list is applied to specializations
(when determining its type) and not to function
templates.</P>

<P>What makes me think so is the contents of 14.5.6.1 [temp.over.link]
and the following sentence from 14.8.2.1 [temp.deduct.call] "If P is a
cv-qualified type, the top level cv-qualifiers of P
are ignored for type deduction". If the transformation
was to be applied to function templates, then there
would be no reason for having that sentence in
14.8.2.1 [temp.deduct.call].</P>

<P>14.8.2.2 [temp.deduct.funcaddr], which my example is
based upon, says nothing
about ignoring the top level cv-qualifiers of the
function parameters of the function template whose
address is being taken.</P>

<P>As a result, I expect that template argument deduction
will fail for the 2-nd and 3-d member templates and
the 1-st one will be used for the instantiation of the
specialization.</P>

<BR><BR><HR><A NAME="1644"></A><H4>1644.
  
Equivalent <I>exception-specification</I>s in function template declarations
</H4><B>Section: </B>14.5.6.1&#160; [temp.over.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-03-17<BR>




<P>Although 15.4 [except.spec] paragraph 3 says,</P>

<BLOCKQUOTE>

<P>Two <I>exception-specification</I>s are <I>compatible</I> if:</P>

<UL><LI><P>...</P></LI>

<LI><P>both have the
form <TT>noexcept(</TT><I>constant-expression</I><TT>)</TT>
and the <I>constant-expression</I>s are equivalent,
or</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<P>it is not clear whether &#8220;equivalent&#8221; in this context
should be taken as a reference to the definition of
<I>equivalent</I> given in 14.5.6.1 [temp.over.link] paragraph
5:</P>

<BLOCKQUOTE>

Two expressions involving template parameters are considered
<I>equivalent</I> if two function definitions containing the
expressions would satisfy the one definition rule
(3.2 [basic.def.odr]), except that the tokens used to
name the template parameters may differ as long as a token
used to name a template parameter in one expression is
replaced by another token that names the same template
parameter in the other expression.

</BLOCKQUOTE>

<P>since the context there is expressions that appear in function
template parameters and return types.</P>

<P>There is implementation variance on this question.</P>

<BR><BR><HR><A NAME="2025"></A><H4>2025.
  
Declaration matching via alias templates
</H4><B>Section: </B>14.5.6.1&#160; [temp.over.link]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-17<BR>




<P>Consider the following example:</P>

<PRE>
  template&lt;typename ...T&gt; struct X { void f(); static int n; };
  template&lt;typename T, typename U&gt; using A = T;
  template&lt;typename ...T&gt; void X&lt;A&lt;T, decltype(sizeof(T))&gt;...&gt;::f() {}
  template&lt;typename ...T&gt; void X&lt;A&lt;T, decltype(sizeof(T))&gt;...&gt;::n = 0;
  void g() { X&lt;void&gt;().f(); X&lt;void&gt;::n = 1; }
</PRE>

<P>Should this be valid?  The best answer would seem to be to produce
an error during instantiation, and that appears to be consistent with
the current Standard wording, but there is implementation divergence.</P>

<P>See also <A HREF="
     cwg_closed.html#2021">issue 2021</A>.</P>

<BR><BR><HR><A NAME="402"></A><H4>402.
  
More on partial ordering of function templates
</H4><B>Section: </B>14.5.6.2&#160; [temp.func.order]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Nathan Sidwell
 &#160;&#160;&#160;

 <B>Date: </B>7 Apr 2003<BR>




<P>This was split off from <A HREF="
     cwg_defects.html#214">issue 214</A> at
the April 2003 meeting.</P>

<P><U>Nathan Sidwell</U>:
John Spicer's proposed resolution does not make the following
well-formed.</P>
<PRE>
  template &lt;typename T&gt; int Foo (T const *) {return 1;} //#1
  template &lt;unsigned I&gt; int Foo (char const (&amp;)[I]) {return 2;} //#2

  int main ()
  {
    return Foo ("a") != 2;
  }
</PRE>
<P>Both #1 and #2 can deduce the "a" argument, #1 deduces T as char and
#2 deduces I as 2. However, neither is more specialized because the
proposed rules do not have any array to pointer decay.</P>

<P>#1 is only deduceable because of the rules in
14.8.2.1 [temp.deduct.call] paragraph 2 that
decay array and function type arguments when the template parameter is
not a reference. Given that such behaviour happens in deduction, I believe
there should be equivalent behaviour during partial ordering. #2 should be
resolved as more specialized as #1. The following alteration to the
proposed resolution of DR214 will do that.</P>

<P>Insert before,</P>
<UL>
<LI>If A is a cv-qualified type, A is replaced by the
         cv-unqualified version of A.</LI>
</UL>
<P>the following</P>
<UL>
<LI>If P was not originally a reference type,
<UL>
<LI>If A is an array type, A is replaced by the pointer type produced
            by the array to pointer conversion</LI>
<LI>If A is a function type, A is replaced by the pointer type
            produced by the function to pointer conversion</LI>
</UL>
</LI>
</UL>

<P>For the example above, this change results in deducing 'T const *' against
'char const *' in one direction (which succeeds), and 'char [I]'
against 'T const *' in the other (which fails).</P>

<P><U>John Spicer</U>:
I don't consider this a shortcoming of my proposed wording, as I don't
think this is part of the current rules.  In other words, the
resolution of 214 might make it clearer how this case is handled
(i.e., clearer that it is not allowed), but I don't believe it
represents a change in the language.</P>

<P>I'm not necessarily opposed to such a change, but I think it should be
reviewed by the core group as a related change and not a defect in the
proposed resolution to 214.</P>

<P><B>Notes from the October 2003 meeting:</B></P>

<P>There was some sentiment that it would be desirable to have
this case ordered, but we don't think it's worth spending the
time to work on it now.  If we look at some larger partial
ordering changes at some point, we will consider this again.</P>

<BR><BR><HR><A NAME="1157"></A><H4>1157.
  
Partial ordering of function templates is still underspecified
</H4><B>Section: </B>14.5.6.2&#160; [temp.func.order]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>CA
 &#160;&#160;&#160;

 <B>Date: </B>2010-08-03<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3296.html#CA7">N3092 comment
  CA&#160;7<BR></A>

<P>14.5.6.2 [temp.func.order] paragraph 3 says,</P>

<BLOCKQUOTE>

To produce the transformed template, for each type,
non-type, or template template parameter (including template
parameter packs (14.5.3 [temp.variadic]) thereof)
synthesize a unique type, value, or class template
respectively and substitute it for each occurrence of that
parameter in the function type of the template.

</BLOCKQUOTE>

<P>The characteristics of the synthesized entities and how they
are determined is not specified.  For example, members of a dependent
type referred to in non-deduced contexts are not specified to exist,
even though the transformed function type would be invalid in their
absence.</P>

<P>Example 1:</P>

<PRE>
  template&lt;typename T, typename U&gt; struct A;
  template&lt;typename T&gt; void foo(A&lt;T, typename T::u&gt; *) { } //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> synthetic </SPAN>T1<SPAN style="font-family:Times;font-style:italic"> has member </SPAN>T1::u
  template &lt;typename T&gt; void foo(A&lt;T, typename T::u::v&gt; *) { } //<SPAN style="font-family:Times;font-style:italic"> #2</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> synthetic </SPAN>T2<SPAN style="font-family:Times;font-style:italic"> has member </SPAN>T2::u<SPAN style="font-family:Times;font-style:italic"> and member </SPAN>T2::u::v
    //<SPAN style="font-family:Times;font-style:italic"> </SPAN>T<SPAN style="font-family:Times;font-style:italic"> in #1 deduces to synthetic </SPAN>T2<SPAN style="font-family:Times;font-style:italic"> in partial ordering;</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> deduced </SPAN>A<SPAN style="font-family:Times;font-style:italic"> for the parameter is </SPAN>A&lt;T2, T2::u&gt; *<SPAN style="font-family:Times;font-style:italic"> --this is not necessarily compatible</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> with </SPAN>A&lt;T2, T2::u::v&gt; *<SPAN style="font-family:Times;font-style:italic"> and it does not need to be. See Note 1. The effect is that</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> (in the call below) the compatibility of </SPAN>B::u<SPAN style="font-family:Times;font-style:italic"> and </SPAN>B::u::v<SPAN style="font-family:Times;font-style:italic"> is respected.</SPAN>
    //<SPAN style="font-family:Times;font-style:italic"> </SPAN>T<SPAN style="font-family:Times;font-style:italic"> in #2 cannot be successfully deduced in partial ordering from </SPAN>A&lt;T1, T1::u&gt; *;
    //<SPAN style="font-family:Times;font-style:italic"> invalid type </SPAN>T1::u::v<SPAN style="font-family:Times;font-style:italic"> will be formed when </SPAN>T1<SPAN style="font-family:Times;font-style:italic"> is substituted into non-deduced contexts.</SPAN>
  struct B {
    struct u { typedef u v; };
  };
  int main() {
    foo((A&lt;B, B::u&gt; *)0); //<SPAN style="font-family:Times;font-style:italic"> calls #2</SPAN>
  }
</PRE>

<P>Note 1: Template argument deduction is an attempt to
match a <TT>P</TT> and a deduced <TT>A</TT>; however,
template argument deduction is not specified to fail if the
<TT>P</TT> and the deduced <TT>A</TT> are incompatible. This
may occur in the presence of non-deduced contexts.
Notwithstanding the parenthetical statement in 14.8.2.4 [temp.deduct.partial] paragraph 9, template argument deduction
may succeed in determining a template argument for every
template parameter while producing a deduced <TT>A</TT> that
is not compatible with the corresponding <TT>P</TT>.</P>

<P>Example 2:</P>

<PRE>
  template &lt;typename T, typename U, typename V&gt; struct A;
  template &lt;typename T&gt;
    void foo(A&lt;T, struct T::u, struct T::u::u&gt; *); //<SPAN style="font-family:Times;font-style:italic"> #2.1</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> synthetic </SPAN>T1<SPAN style="font-family:Times;font-style:italic"> has member non-union class </SPAN>T1::u
  template &lt;typename T, typename U&gt;
    void foo(A&lt;T, U , U&gt; *); //<SPAN style="font-family:Times;font-style:italic"> #2.2</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> synthetic </SPAN>T2<SPAN style="font-family:Times;font-style:italic"> and </SPAN>U2<SPAN style="font-family:Times;font-style:italic"> has no required properties</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>T<SPAN style="font-family:Times;font-style:italic"> in #2.1 cannot be deduced in partial ordering from </SPAN>A&lt;T2, U2, U2&gt; *;
      //<SPAN style="font-family:Times;font-style:italic"> invalid types </SPAN>T2::u<SPAN style="font-family:Times;font-style:italic"> and </SPAN>T2::u::u<SPAN style="font-family:Times;font-style:italic"> will be formed when </SPAN>T2<SPAN style="font-family:Times;font-style:italic"> is substituted in nondeduced contexts.</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>T<SPAN style="font-family:Times;font-style:italic"> and </SPAN>U<SPAN style="font-family:Times;font-style:italic"> in #2.2 deduces to, respectively, </SPAN>T1<SPAN style="font-family:Times;font-style:italic"> and </SPAN>T1::u<SPAN style="font-family:Times;font-style:italic"> from </SPAN>A&lt;T1, T1::u, struct
T1::u::u&gt; *<SPAN style="font-family:Times;font-style:italic"> unless</SPAN>
      //<SPAN style="font-family:Times;font-style:italic"> </SPAN>struct T1::u::u<SPAN style="font-family:Times;font-style:italic"> does not refer to the injected-class-name of the class </SPAN>T1::u<SPAN style="font-family:Times;font-style:italic"> (if that is possible).</SPAN>
  struct B {
    struct u { };
  };
  int main() {
    foo((A&lt;B, B::u, struct B::u::u&gt; *)0); //<SPAN style="font-family:Times;font-style:italic"> calls #2.1</SPAN>
  }
</PRE>

<P>It is, however, unclear to what extent an implementation
will have to go to determine these minimal properties.</P>

<BR><BR><HR><A NAME="1979"></A><H4>1979.
  
Alias template specialization in template member definition
</H4><B>Section: </B>14.5.7&#160; [temp.alias]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-31<BR>




<P>In an example like</P>

<PRE>
  template&lt;typename T&gt; struct A {
    struct B {
      void f();
    };
  };

  template&lt;typename T&gt; using X = typename A&lt;T&gt;::B;

  template&lt;typename T&gt; void X&lt;T&gt;::f() { }       //<SPAN style="font-family:Times;font-style:italic"> #1</SPAN>
</PRE>

<P>should #1 be considered a definition of <TT>A&lt;T&gt;::B::f()</TT>?</P>

<P>Analogy with <I>alias-declaration</I>s would suggest that
it should, but alias template specializations involve issues
like SFINAE on unused template parameters (see
<A HREF="
     cwg_defects.html#1558">issue 1558</A>) and possibly other
complications.</P>

<P>(See also issues <A HREF="
     cwg_active.html#1980">1980</A>,
<A HREF="
     cwg_closed.html#2021">2021</A>, and <A HREF="
     cwg_active.html#2025">2025</A>.)</P>

<BR><BR><HR><A NAME="1257"></A><H4>1257.
  
Instantiation via non-dependent references in uninstantiated templates
</H4><B>Section: </B>14.6&#160; [temp.res]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-09<BR>




<P>The Standard does not appear to specify whether a non-dependent
reference to a template specialization in a template definition that is
never instantiated causes the implicit instantiation of the referenced
specialization.</P>

<BR><BR><HR><A NAME="1974"></A><H4>1974.
  
Redundant specification of non-type <I>typename-specifier</I>
</H4><B>Section: </B>14.6&#160; [temp.res]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-17<BR>




<P>Paragraphs 3-4 of 14.6 [temp.res] read, in part,</P>

<BLOCKQUOTE>

<P>When a <I>qualified-id</I> is intended to refer to a type
that is not a member of the current instantiation
(14.6.2.1 [temp.dep.type]) and
its <I>nested-name-specifier</I> refers to a dependent type,
it shall be prefixed by the keyword <TT>typename</TT>, forming
a <I>typename-specifier</I>. If the <I>qualified-id</I> in
a <I>typename-specifier</I> does not denote a type, the
program is ill-formed.</P>

<P>If a specialization of a template is instantiated for a set
of <I>template-argument</I>s such that
the <I>qualified-id</I> prefixed by typename does not denote
a type, the specialization is ill-formed.</P>

</BLOCKQUOTE>

<P>The former requirement is intended to apply to the definition
and the latter to an instantiation of a template, but that intent
is not completely clear, leading to the perception that they are
redundant.</P>

<BR><BR><HR><A NAME="186"></A><H4>186.
  
Name hiding and template <I>template-parameter</I>s
</H4><B>Section: </B>14.6.1&#160; [temp.local]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>11 Nov 1999<BR>





<P>The standard prohibits a class template from having the same name as
one of its template parameters
(14.6.1 [temp.local]
 paragraph 4).  This prohibits</P>

<PRE>
    template &lt;class X&gt; class X;
</PRE>

for the reason that the template name would hide the parameter, and
such hiding is in general prohibited.

<P>Presumably, we should also prohibit</P>

<PRE>
    template &lt;template &lt;class T&gt; class T&gt; struct A;
</PRE>

for the same reason.
<BR><BR><HR><A NAME="459"></A><H4>459.
  
Hiding of template parameters by base class members
</H4><B>Section: </B>14.6.1&#160; [temp.local]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2 Feb 2004<BR>


<P>Currently, member of nondependent base classes hide
references to template parameters in the definition
of a derived class template.</P>

<P>Consider the following example:</P>
<PRE>
   class B {
      typedef void *It;    // (1)
      // ...
    };

    class M: B {};

    template&lt;typename&gt; X {};

    template&lt;typename It&gt; struct S   // (2)
        : M, X&lt;It&gt; {   // (3)
      S(It, It);   // (4)
      // ...
    };
</PRE>
<P>As the C++ language currently stands, the name "It"
in line (3) refers to the template parameter declared
in line (2), but the name "It" in line (4) refers to
the typedef in the private base class (declared in
line (1)).</P>

<P>This situation is both unintuitive and a hindrance
to sound software engineering.  (See also the Usenet
discussion at http://tinyurl.com/32q8d .)  Among
other things, it implies that the private section
of a base class may change the meaning of the derived
class, and (unlike other cases where such things
happen) there is no way for the writer of the derived
class to defend the code against such intrusion (e.g.,
by using a qualified name).</P>

<P>Changing this can break code that is valid today.
However, such code would have to:
<OL>
<LI>
name a template parameter and not use it
         after the opening brace, and
</LI>
<LI>
use that same name to access a base-class
         name within the braces.
</LI>
</OL>
I personally have no qualms breaking such a program.</P>

<P>It has been suggested to make situations like these
ill-formed.  That solution is unattractive however
because it still leaves the writer of a derived class
template without defense against accidental name
conflicts with base members.  (Although at least the
problem would be guaranteed to be caught at compile
time.)  Instead, since just about everyone's intuition
agrees, I would like to see the rules changed to
make class template parameters hide members of the
same name in a base class.</P>

<P>See also <A HREF="
     cwg_defects.html#458">issue 458</A>.</P>

<P><B>Notes from the March 2004 meeting:</B></P>

<P>We have some sympathy for a change, but the current rules fall
straightforwardly out of the lookup rules, so they're not
&#8220;wrong.&#8221; Making private members invisible also would solve
this problem.  We'd be willing to look at a paper proposing that.</P>

<P><B>Additional discussion (April, 2005):</B></P>



<P><U>John Spicer</U>: Base class members are more-or-less treated as
members of the class, [so] it is only natural that the base [member]
would hide the template parameter.</P>

<P><U>Daveed Vandevoorde</U>: Are base class members really
&#8220;more or less&#8221; members of the class from a lookup
perspective?  After all, derived class members can hide base class
members of the same name.  So there is some pretty definite
boundary between those two sets of names.  IMO, the template
parameters should either sit between those two sets, or they
should (for lookup purposes) be treated as members of the class
they parameterize (I cannot think of a practical difference
between those two formulations).</P>

<P><U>John Spicer</U>: How is [hiding template parameters]
different from the fact that namespace members can be hidden
by private parts of a base class?  The addition of <TT>int C</TT>
to <TT>N::A</TT> breaks the code in namespace <TT>M</TT> in this
example:</P>

<PRE>
    namespace N {
       class A {
    private:
         int C;
       };
    }

    namespace M {
       typedef int C;
       class B : public N::A {
         void f() {
             C c;
         }
       };
    }
</PRE>

<P><U>Daveed Vandevoorde</U>: C++ has a mechanism in place to handle
such situations: qualified names.  There is no such mechanism in place
for template parameters.</P>

<P><U>Nathan Myers</U>: What I see as obviously incorrect ... is
simply that a name defined right where I can see it, and directly
attached to the textual scope of <TT>B</TT>'s class body, is ignored
in favor of something found in some other file.  I don't care that
<TT>C1</TT> is defined in <TT>A</TT>, I have a <TT>C1</TT> right
here that I have chosen to use.  If I want <TT>A::C1</TT>, I can
say so.</P>

<P>I doubt you'll find any regular C++ coder who doesn't find the
standard behavior bizarre.  If the meaning of any code is changed
by fixing this behavior, the overwhelming majority of cases will
be mysterious bugs magically fixed.</P>

<P><U>John Spicer</U>: I have not heard complaints that this is
actually a cause of problems in real user code.  Where is the
evidence that the status quo is actually causing problems?</P>

<P>In this example, the <TT>T2</TT> that is found is the one from
the base class.  I would argue that this is natural because base
class members are found as part of the lookup in class <TT>B</TT>:</P>

<PRE>
    struct A {
             typedef int T2;
    };
    template &lt;class T2&gt; struct B : public A {
             typedef int T1;
             T1 t1;
             T2 t2;
    };
</PRE>

<P>This rule that base class members hide template parameters was
formalized about a dozen years ago because it fell out of the
principle that base class members should be found at the same
stage of lookup as derived class members, and that to do otherwise
would be surprising.</P>

<P><U>Gabriel Dos Reis</U>: The bottom line is that:</P>

<OL>

<LI>the proposed change is a <B>silent</B> change of meaning;</LI>

<LI>the proposed change does not make the language any more regular;
the current behavior is consistent with everything else, however
&#8220;surprising&#8221; that might be;</LI>

<LI>the proposed change does have its own downsides.</LI>

</OL>

<P>Unless presented with real major programming problems the current
rules exhibit, I do not think the simple rule &#8220;scopes
nest&#8221; needs a change that silently mutates program meaning.</P>

<P><U>Mike Miller</U>: The rationale for the current specification is
really very simple:</P>

<OL>

<LI>&#8220;Unless redeclared in the derived class, members of a base
class are also considered to be members of the derived class.&#8221;
(10 [class.derived] paragraph 2)</LI>

<LI>In class scope, members hide nonmembers.</LI>

</OL>

<P>That's it.  Because template parameters are not members, they
are hidden by member names (whether inherited or not).  I don't find
that &#8220;bizarre,&#8221; or even particularly surprising.</P>

<P>I believe these rules are straightforward and consistent, so I
would be opposed to changing them.  However, I am not unsympathetic
toward Daveed's concern about name hijacking from base classes.  How
about a rule that would make a program ill-formed if a direct or
inherited member hides a template parameter?</P>

<P>Unless this problem is a lot more prevalent than I've heard so
far, I would not want to change the lookup rules; making this kind of
collision a diagnosable error, however, would prevent hijacking
without changing the lookup rules.</P>

<P><U>Erwin Unruh</U>: I have a different approach that is consistent
and changes the interpretation of the questionable code.  At present
lookup is done in this sequence:</P>

<UL>
block scope<BR>
derived class scope<BR>
base class scope<BR>
template parameters<BR>
namespace scope
</UL>

<P>If we change this order to</P>

<UL>
template parameters<BR>
block scope<BR>
derived class scope<BR>
base class scope<BR>
namespace scope<BR>
</UL>

<P>it is still consistent in that no lookup is placed between the base
class and the derived class.  However, it introduces another
inconsistency: now scopes do not nest the same way as curly braces
nest &#8212; but base classes are already inconsistent this way.</P>

<P><U>Nathan Myers</U>: This looks entirely satisfactory.  If even this
seems like too big a change, it would suffice to say that finding a
different name by this search order makes the program ill-formed.
Of course, a compiler might issue only a portability warning in that
case and use the name found Erwin's way, anyhow.</P>

<P><U>Gabriel Dos Reis</U>: It is a simple fact, even without
templates, that a writer of a derived class cannot protect himself
against declaration changes in the base class.</P>

<P><U>Richard Corden</U>: If a change is to be made, then making it
ill-formed is better than just changing the lookup rules.</P>

<PRE>
    struct B
    {
      typedef int T;
      virtual void bar (T const &amp; );
    };

    template &lt;typename T&gt;
    struct D : public B
    {
      virtual void bar (T const &amp; );
    };

    template class D&lt;float&gt;;
</PRE>

<P>I think changing the semantics of the above code silently would
result in very difficult-to-find problems.</P>

<P><U>Mike Miller</U>: Another case that may need to be considered in
deciding on Erwin's suggestion or the &#8220;ill-formed&#8221;
alternative is the treatment of <TT>friend</TT> declarations
described in 3.4.1 [basic.lookup.unqual] paragraph 10:</P>

<PRE>
    struct A {
        typedef int T;
        void f(T);
    };
    template&lt;typename T&gt; struct B {
        friend void A::f(T);  //<SPAN style="font-family:Times;font-style:italic"> Currently </SPAN>T<SPAN style="font-family:Times;font-style:italic"> is </SPAN>A::T
    };
</PRE>

<P><B>Notes from the October, 2005 meeting:</B></P>

<P>The CWG decided not to consider a change to the existing rules at
this time without a paper exploring the issue in more detail.</P>
<BR><BR><HR><A NAME="1619"></A><H4>1619.
  
Definition of current instantiation
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-04<BR>




<P>The definition of the current instantiation, given in
14.6.2.1 [temp.dep.type] paragraph 1, is phrased in terms of the
meaning of a name (&#8220;A name refers to the <I>current
instantiation</I> if it is...&#8221;); it does not define when a type
is the current instantiation.  Thus the interpretation of <TT>*this</TT>
and of phrases like &#8220;member of a class that is the current
instantiation&#8221; is not formally specified.</P>

<BR><BR><HR><A NAME="1829"></A><H4>1829.
  
Dependent unnamed types
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-08<BR>




<P>The specification of dependent types in 14.6.2.1 [temp.dep.type]
is given in terms of names.  However, one might consider some unnamed
types as dependent.  Consider the following example:</P>

<PRE>
  template &lt;typename T&gt; struct A {
    struct { } obj;
    void foo() {
      bar(obj); //<SPAN style="font-family:Times;font-style:italic"> lookup for </SPAN>bar<SPAN style="font-family:Times;font-style:italic"> when/where?</SPAN>
    }
  };

  void bar(...);

  int main() {
    A&lt;int&gt; a;
    a.foo();    //<SPAN style="font-family:Times;font-style:italic"> calls </SPAN>bar(...)<SPAN style="font-family:Times;font-style:italic">?</SPAN>
  }
</PRE>

<P>If the type of <TT>A::obj</TT> had a name, it would be
dependent.  However, the rationale for making nested types
dependent is that they are subject to explicit
specialization and thus not knowable at the point of the
template definition.  An unnamed type, as in this example,
cannot be explicitly specialized and thus could be
considered as a member of the current instantiation.  Which
treatment is intended?</P>

<P><B>Notes from the February, 2014 meeting:</B></P>

<P>There are other cases in which a named entity is dependnet, even
though it cannot be explicitly specialized.  CWG felt that the most
consistent rule would be to make all nested classes dependent, whether
named or not.</P>

<BR><BR><HR><A NAME="2024"></A><H4>2024.
  
Dependent types and unexpanded parameter packs
</H4><B>Section: </B>14.6.2.1&#160; [temp.dep.type]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-10-17<BR>




<P>Consider an example like:</P>

<PRE>
  template&lt;typename ...Ts&gt; struct X { X(int); };
  template&lt;typename T&gt; using Y = int;
  template&lt;typename ...Ts&gt; void f() {
    X&lt;Y&lt;Ts&gt;...&gt; x;
  }
</PRE>

<P>The presence of the ellipsis should make the reference to
<TT>A</TT> a dependent type, but there is no rule making it so.</P>

<BR><BR><HR><A NAME="1028"></A><H4>1028.
  
Dependent names in non-defining declarations
</H4><B>Section: </B>14.6.4&#160; [temp.dep.res]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Sean Hunt
 &#160;&#160;&#160;

 <B>Date: </B>2010-02-03<BR>


<P>The current wording of 14.6.4 [temp.dep.res] seems to assume
that dependent names can only appear in the definition of a template:</P>

<BLOCKQUOTE>

<P>In resolving dependent names, names from the following sources
are considered:</P>

<UL><LI><P>Declarations that are visible at the point of
definition of the template.</P></LI>

<LI><P>Declarations from namespaces associated with the types of
the function arguments both from the instantiation context
(14.6.4.1 [temp.point]) and from the definition context.</P></LI>

</UL>

</BLOCKQUOTE>

<P>However, dependent names can occur in non-defining declarations of
the template as well; for instance,</P>

<PRE>
    template&lt;typename T&gt;
    T foo(T, decltype(bar(T())));
</PRE>

<P><TT>bar</TT> needs to be looked up, even though there is no
definition of <TT>foo</TT> in the translation unit.</P>

<P><B>Additional note (February, 2011):</B></P>

<P>The resolution of this issue can't simply replace the word
&#8220;definition&#8221; with the word &#8220;declaration,&#8221;
<I>mutatis mutandis</I>, because there can be multiple declarations
in a translation unit (which isn't true of &#8220;the definition&#8221;).
As a result, the issue was moved back to "open" status for further
consideration.</P>

<BR><BR><HR><A NAME="1500"></A><H4>1500.
  
Name lookup of dependent conversion function
</H4><B>Section: </B>14.6.4.2&#160; [temp.dep.candidate]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Johannes Schaub
 &#160;&#160;&#160;

 <B>Date: </B>2012-04-27<BR>




<P>Consider the following example:</P>

<PRE>
  template&lt;typename T&gt;
  struct A {
   operator int() { return 0; }

   void f() {
    operator T();
   }
  };

  int main() {
   A&lt;int&gt; a;
   a.f();
  }
</PRE>

<P>One might expect this to call <TT>operator int</TT> when
instantiating. But since <TT>operator T</TT> is a dependent name, it
is looked up by unqualified lookup only in the definition context,
where it will find no declaration. Argument-dependent lookup will not
find anything in the instantiation context either, so this code is
ill-formed. If we change <TT>operator&#160;int()</TT> to
<TT>operator&#160;T()</TT>, which is a seemingly unrelated change, the
code becomes well-formed.</P>

<P>There is implementation variability on this point.</P>

<BR><BR><HR><A NAME="1378"></A><H4>1378.
  
When is an instantiation required?
</H4><B>Section: </B>14.7.1&#160; [temp.inst]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-18<BR>




<P>A template instantiation can be &#8220;required&#8221; without
there being a need for it at link time if it can appear in a
constant expression:</P>

<PRE>
    template &lt;class T&gt; struct A {
       static const T t;
    };
    template &lt;class T&gt; const T A&lt;T&gt;::t = 0;
    template &lt;int I&gt; struct B { };
    int a = sizeof(B&lt;A&lt;int&gt;::t&gt;);

    template &lt;class T&gt; constexpr T f(T t) { return t; }
    int b = sizeof(B&lt;f(42)&gt;);
</PRE>

<P>It seems like it might be useful to define a term other than odr-used 
for this sort of use, which is like odr-used but doesn't depend on 
potentially evaluated context or lvalue-rvalue conversions.</P>

<P><U>Nikolay Ivchenkov:</U></P>

<P>Another possibility would be to introduce the extension
described in the closed <A HREF="
     cwg_closed.html#1272">issue 1272</A> and
then change 3.2 [basic.def.odr] paragraph 2 as follows:</P>

<BLOCKQUOTE>

<P>An expression <SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>E</TT></SPAN> is <I>potentially
evaluated</I> <SPAN style="text-decoration:line-through;background-color:#FFA0A0">unless it is an unevaluated operand (Clause
5 [expr]) or a subexpression thereof.</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">if and only if</SPAN></P>

<UL><LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>E</TT> is a full-expression, or</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>E</TT> appears in a context where a constant expression
is required, or</SPAN></P></LI>

<LI><P><SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>E</TT> is a direct subexpression of a potentially-evaluated
expression and <TT>E</TT> is not an unevaluated operand.</SPAN></P></LI>

</UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">An expression <TT>S</TT> is a <I>direct subexpression</I> of an
expression <TT>E</TT> if and only if <TT>S</TT> and <TT>E</TT>
are different expressions, <TT>S</TT> is a subexpression of
<TT>E</TT>, and there is no expression <TT>X</TT> such that
<TT>X</TT> differs from both <TT>S</TT> and <TT>E</TT>,
<TT>S</TT> is a subexpression of <TT>X</TT>, and <TT>X</TT> is a
subexpression of <TT>E</TT>.</SPAN> A variable whose name appears
as a potentially-evaluated expression is <I>odr-used</I>
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">unless it is an object that satisfies the requirements for
appearing in a constant expression (5.20 [expr.const])
and the lvalue-to-rvalue conversion (4.1) is immediately
applied</SPAN>...</P>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Example:</I></SPAN></P>

<PRE>
<SPAN style="font-weight:bold;background-color:#A0FFA0">    template &lt;class T&gt; struct X {
        static int const m = 1;
        static int const n;
    };
    template &lt;class T&gt; int const X&lt;T&gt;::n = 2;

    int main() {
        //<SPAN style="font-family:Times;font-style:italic"> </SPAN>X&lt;void&gt;::m<SPAN style="font-family:Times;font-style:italic"> is odr-used,</SPAN>
        //<SPAN style="font-family:Times;font-style:italic"> </SPAN>X&lt;void&gt;::m<SPAN style="font-family:Times;font-style:italic"> is defined implicitly</SPAN>
        std::cout &lt;&lt; X&lt;void&gt;::m &lt;&lt; std::endl;

        //<SPAN style="font-family:Times;font-style:italic"> </SPAN>X&lt;void&gt;::n<SPAN style="font-family:Times;font-style:italic"> is odr-used,</SPAN>
        //<SPAN style="font-family:Times;font-style:italic"> </SPAN>X&lt;void&gt;::n<SPAN style="font-family:Times;font-style:italic"> is defined explicitly</SPAN>
        std::cout &lt;&lt; X&lt;void&gt;::n &lt;&lt; std::endl;

        //<SPAN style="font-family:Times;font-style:italic"> OK (issue 712 is not relevant here)</SPAN>
        std::cout &lt;&lt; (1 ? X&lt;void&gt;::m : X&lt;void&gt;::n) &lt;&lt; std::endl;
    }
</SPAN></PRE>

</BLOCKQUOTE>

<P>(See also issues <A HREF="
     cwg_defects.html#712">712</A> and
<A HREF="
     cwg_closed.html#1254">1254</A>.)</P>

<BR><BR><HR><A NAME="1602"></A><H4>1602.
  
Linkage of specialization vs linkage of template arguments
</H4><B>Section: </B>14.7.1&#160; [temp.inst]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2013-01-09<BR>




<P>The Standard does not appear to specify the linkage of a template
specialization.  14.7.1 [temp.inst] paragraph 11 does say,</P>

<BLOCKQUOTE>

Implicitly instantiated class and function template specializations
are placed in the namespace where the template is defined.

</BLOCKQUOTE>

<P>which could be read as implying that the specialization has the
same linkage as the template itself.  Implementation practice seems to
be that the weakst linkage of the template and the arguments is used
for the specialization.</P>

<BR><BR><HR><A NAME="1856"></A><H4>1856.
  
Indirect nested classes of class templates
</H4><B>Section: </B>14.7.1&#160; [temp.inst]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-11<BR>


<P>During the discussion of <A HREF="
     cwg_defects.html#1484">issue 1484</A>, it was
observed that the current rules do not adequately address indirect nested
classes of class templates (i.e., member classes of member classes of class
templates) in regard to their potential separate instantiation.</P>

<BR><BR><HR><A NAME="293"></A><H4>293.
  
Syntax of explicit instantiation/specialization too permissive
</H4><B>Section: </B>14.7.2&#160; [temp.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mark Mitchell
 &#160;&#160;&#160;

 <B>Date: </B>27 Jun 2001<BR>


<P>14.7.2 [temp.explicit] defines an explicit instantiation as</P>

<UL><I>explicit-instantiation</I>:
<UL><TT>template</TT> <I>declaration</I></UL>
</UL>

<P>Syntactically, that allows things like:</P>
<PRE>
    template int S&lt;int&gt;::i = 5, S&lt;int&gt;::j = 7;
</PRE>

<P>which isn't what anyone actually expects.  As far as I can tell,
nothing in the standard explicitly forbids this, as written.  Syntactically,
this also allows:</P>

<PRE>
    template namespace N { void f(); }
</PRE>

<P>although perhaps the surrounding context is enough to suggest that this is
invalid.</P>

<P><B>Suggested resolution:</B></P>

<P>I think we should say:</P>

<UL><I>explicit-instantiation</I>:
<UL><I>type-specifier-seq</I><SUB>opt</SUB>
    <I>declarator</I><SUB>opt</SUB> <TT>;</TT></UL>
</UL>

<P><I>[Steve Adamczyk: presumably, this should have</I>
<TT>template</TT> <I>at the beginning.]</I></P>

<P>and then say that:</P>

<UL>
<LI>
The declarator can be omitted only when the <I>type-specifier-seq</I>
consists solely of an <I>elaborated-type-specifier</I> for a class type, in
which case the instantiation is for the named class.  If the
declarator is present the instantiation is for the named entity.
</LI>
<LI>
The <I>type-specifier-seq</I> can be omitted only when the declarator
is for a constructor, destructor, or conversion operator.
</LI>
<LI>
The <I>type-specifier-seq</I> cannot define any new types.
</LI>
</UL>

<P>There are similar problems in 14.7.3 [temp.expl.spec]:</P>

<UL><I>explicit-specialization</I>:
<UL><TT>template</TT> &lt;&gt; <I>declaration</I></UL>
</UL>

<P>Here, I think we want:</P>

<UL><I>explicit-specialization</I>:
<UL><I>decl-specifier-seq</I><SUB>opt</SUB> <I>init-declarator</I><SUB>opt</SUB> <TT>;</TT></UL>
</UL>

<P>with similar restrictions as above.</P>

<P><I>[Steve Adamczyk: This also needs to have</I>
<TT>template &lt;&gt;</TT> <I>at the beginning, possibly repeated.]</I></P>



<BR><BR><HR><A NAME="1046"></A><H4>1046.
  
What is a &#8220;use&#8221; of a class specialization?
</H4><B>Section: </B>14.7.2&#160; [temp.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2010-03-08<BR>


<P>According to 14.7.2 [temp.explicit] paragraph 10,</P>

<BLOCKQUOTE>

An entity that is the subject of an explicit instantiation
declaration and that is also used in the translation unit shall
be the subject of an explicit instantiation definition somewhere
in the program; otherwise the program is ill-formed, no
diagnostic required.

</BLOCKQUOTE>

<P>The term &#8220;used&#8221; is too vague and needs to be defined.
In particular, &#8220;use&#8221; of a class template specialization as
an incomplete type &#8212; to form a pointer, for instance &#8212;
should not require the presence of an explicit instantiation definition
elsewhere in the program.</P>

<BR><BR><HR><A NAME="1993"></A><H4>1993.
  
Use of <TT>template&lt;&gt;</TT> defining member of explicit specialization
</H4><B>Section: </B>14.7.3&#160; [temp.expl.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-08-31<BR>




<P><A HREF="
     cwg_defects.html#531">Issue 531</A> surveyed existing practice at
the time and determined that the most common syntax for defining a member
of an explicit specialization used the <TT>template&lt;&gt;</TT>
prefix.  This approach, however, does not seem consistent, since such
a definition is not itself an explicit specialization.</P>



<BR><BR><HR><A NAME="264"></A><H4>264.
  
Unusable template constructors and conversion functions
</H4><B>Section: </B>14.8.1&#160; [temp.arg.explicit]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>17 Nov 2000<BR>




<P>The note in paragraph 5 of 14.8.1 [temp.arg.explicit] makes
clear that explicit template arguments cannot be supplied in
invocations of constructors and conversion functions because they are
called without using a name.  However, there is nothing in the current
wording of the Standard that makes declaring a constructor or
conversion operator that is unusable because of nondeduced parameters
(i.e., that would need to be specified explicitly) ill-formed.  It
would be a service to the programmer to diagnose this useless
construct as early as possible.</P>

<BR><BR><HR><A NAME="271"></A><H4>271.
  
Explicit instantiation and template argument deduction
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>20 Feb 2001<BR>




<P>Nicolai Josuttis sent me an example like the following:</P>

<PRE>
    template &lt;typename RET, typename T1, typename T2&gt;
    const RET&amp; min (const T1&amp; a, const T2&amp; b)
    {
	return (a &lt; b ? a : b);
    }
    template const int&amp; min&lt;int&gt;(const int&amp;,const int&amp;);  // #1
    template const int&amp; min(const int&amp;,const int&amp;);       // #2
</PRE>

<P>Among the questions was whether explicit instantiation #2 is valid,
where deduction is required to determine the type of <TT>RET</TT>.</P>

<P>The first thing I realized when researching this is that the standard
does not really spell out the rules for deduction in declarative
contexts (friend declarations, explicit specializations, and
explicit instantiations).  For explicit instantiations,
14.7.2 [temp.explicit] paragraph 2 does
mention deduction, but it doesn't say which set of deduction rules from
14.8.2 [temp.deduct] should be applied.</P>

<P>Second, Nicolai pointed out that
14.7.2 [temp.explicit] paragraph 6 says</P>

<BLOCKQUOTE>
A trailing <I>template-argument</I>
can be left unspecified in an explicit instantiation provided it can
be deduced from the type of a function parameter
(14.8.2 [temp.deduct]).
</BLOCKQUOTE>

<P>This prohibits cases
like #2, but I believe this was not considered in the wording as there
is no reason not to include the return type in the deduction process.</P>

<P>I think there may have been some confusion because the return type is
excluded when doing deduction on a function call.  But there are
contexts where the return type is included in deduction, for example,
when taking the address of a function template specialization.</P>

<P><U>Suggested resolution</U>:</P>

<OL>

<LI>Update 14.8.2 [temp.deduct] to include a section
"Deducing template arguments from a declaration" that describes how
deduction is done when finding a template that matches a declaration.
This should, I believe, include the return type.</LI>

<LI>Update 14.7.2 [temp.explicit] to make reference to the new
rules in 14.8.2 [temp.deduct] and remove the description of
the deduction details from 14.7.2 [temp.explicit] paragraph
6.</LI>

</OL>
<BR><BR><HR><A NAME="297"></A><H4>297.
  
Which template does an explicit specialization specialize?
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Andrei Iltchenko
 &#160;&#160;&#160;

 <B>Date: </B>7 Jul 2001<BR>


<P>Andrei Iltchenko points out that the standard has no wording that
defines how to determine which template is specialized by an
explicit specialization of a function template.
He suggests "template argument deduction
in such cases proceeds in the same way as when taking the address
of a function template,
which is described in 14.8.2.2 [temp.deduct.funcaddr]."</P>

<P>John Spicer points out that the same problem exists for all
similar declarations, i.e., friend declarations and explicit
instantiation directives.  Finding a corresponding placement
<TT>operator delete</TT> may have a similar problem.</P>

<P><U>John Spicer</U>:
There are two aspects of "determining which template" is referred to by
a declaration: determining the function template associated with the
named specialization, and determining the values of the template arguments
of the specialization.</P>
<PRE>
    template &lt;class T&gt; void f(T);  #1
    template &lt;class T&gt; void f(T*); #2
    template &lt;&gt; void f(int*);
</PRE>

<P>In other words, which <TT>f</TT> is being specialized (#1 or #2)?
And then, what are the deduced template arguments?</P>

<P>14.5.6.2 [temp.func.order] does say that partial ordering is
done in contexts such as this.
Is this sufficient, or do we need to say more about the selection of the
function template to be selected? </P>

<P>14.8.2 [temp.deduct] probably needs a new section to cover
argument deduction for cases like this.</P>

<BR><BR><HR><A NAME="697"></A><H4>697.
  
Deduction rules apply to more than functions
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Doug Gregor
 &#160;&#160;&#160;

 <B>Date: </B>6 June, 2008<BR>




<P>14.8.2 [temp.deduct] is all about function types, but these
rules also apply, e.g., when matching a class template partial
specialization.  We should add a note stating that we could be doing
substitution into the <I>template-id</I> for a class template partial
specialization.</P>

<P><B>Additional note (August 2008):</B></P>

<P>According to 14.5.5.1 [temp.class.spec.match] paragraph 2, argument
deduction is used to determine whether a given partial specialization
matches a given argument list.  However, there is nothing in
14.5.5.1 [temp.class.spec.match] nor in 14.8.2 [temp.deduct] and
its subsections that describes exactly how argument deduction is to
be performed in this case.  It would seem that more than just a note
is required to clarify this processing.</P>

<BR><BR><HR><A NAME="1582"></A><H4>1582.
  
Template default arguments and deduction failure
</H4><B>Section: </B>14.8.2&#160; [temp.deduct]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2012-10-31<BR>


<P>According to 14.8.2 [temp.deduct] paragraph 5,</P>

<BLOCKQUOTE>

The resulting substituted and adjusted function type is used as the
type of the function template for template argument deduction. If a
template argument has not been deduced and its corresponding template
parameter has a default argument, the template argument is determined
by substituting the template arguments determined for preceding
template parameters into the default argument.  If the substitution
results in an invalid type, as described above, type deduction fails.

</BLOCKQUOTE>

<P>This leaves the impression that default arguments are used after
deduction failure leaves an argument undeduced.  For example,</P>

<PRE>
  template&lt;typename T&gt; struct Wrapper;
  template&lt;typename T = int&gt; void f(Wrapper&lt;T&gt;*);
  void g() {
    f(0);
  }
</PRE>

<P>Deduction fails for <TT>T</TT>, so presumably <TT>int</TT> is used.
However, some implementations reject this code.  It appears that the
intent would be better expressed as something like</P>

<BLOCKQUOTE>

...If a template argument is used only in a non-deduced context and
its corresponding template parameter has a default argument...

</BLOCKQUOTE>

<P><B>Rationale (November, 2013):</B></P>

<P>CWG felt that this issue should be considered by EWG in a broader
context before being resolved.</P>

<P><B>Additional note, April, 2015:</B></P>

<P>EWG has requested that CWG resolve this issue along the lines
discussed above. </P>

<BR><BR><HR><A NAME="503"></A><H4>503.
  
Cv-qualified function types in template argument deduction
</H4><B>Section: </B>14.8.2.1&#160; [temp.deduct.call]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>22 Feb 2005<BR>




<P>Consider the following program:</P>

<PRE>
    template &lt;typename T&gt; int ref (T&amp;)                { return 0; }
    template &lt;typename T&gt; int ref (const T&amp;)          { return 1; }
    template &lt;typename T&gt; int ref (const volatile T&amp;) { return 2; }
    template &lt;typename T&gt; int ref (volatile T&amp;)       { return 4; }

    template &lt;typename T&gt; int ptr (T*)                { return 0; }
    template &lt;typename T&gt; int ptr (const T*)          { return 8; }
    template &lt;typename T&gt; int ptr (const volatile T*) { return 16; }
    template &lt;typename T&gt; int ptr (volatile T*)       { return 32; }

    void foo() {}

    int main()
    {
        return ref(foo) + ptr(&amp;foo);
    }
</PRE>

<P>The Standard appears to specify that the value returned from
<TT>main</TT> is 2.  The reason for this result is that references and
pointers are handled differently in template argument deduction.</P>

<P>For the reference case, 14.8.2.1 [temp.deduct.call] paragraph
3 says that &#8220;If <TT>P</TT> is a reference type, the type
referred to by <TT>P</TT> is used for type deduction.&#8221; Because
of <A HREF="
     cwg_defects.html#295">issue 295</A>, all four of the types for the
<TT>ref</TT> function parameters are the same, with no
cv-qualification; overload resolution does not find a best match among
the parameters and thus the most-specialized function is selected.</P>

<P>For the pointer type, argument deduction does not get as far as
forming a cv-qualified function type; instead, argument deduction
fails in the cv-qualified cases because of the cv-qualification
mismatch, and only the cv-unqualified version of <TT>ptr</TT> survives
as a viable function.</P>

<P>I think the choice of ignoring cv-qualifiers in the reference case
but not the pointer case is very troublesome.  The reason is that when
one considers function objects as function parameters, it introduces a
semantic difference whether the function parameter is declared a
reference or a pointer.  In all other contexts, it does not matter: a
function name decays to a pointer and the resulting semantics are the
same.</P>

<P>(See also <A HREF="
     cwg_active.html#1584">issue 1584</A>.)</P>
<BR><BR><HR><A NAME="1584"></A><H4>1584.
  
Deducing function types from cv-qualified types
</H4><B>Section: </B>14.8.2.1&#160; [temp.deduct.call]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-11-04<BR>




<P>It is not clear whether the following is well-formed or not:</P>

<PRE>
  void foo(){}

  template&lt;class T&gt;
  void deduce(const T*) { }

  int main() {
    deduce(foo);
  }
</PRE>

<P>Implementations vary in their treatment of this example.</P>

<P><B>Proposed resolution (April, 2013):</B></P>

<P>Change 14.8.2.5 [temp.deduct.type] paragraph 18 as follows:</P>

<BLOCKQUOTE>

<P>A <I>template-argument</I> can be deduced from a function, pointer to
function, or pointer to member function type. <SPAN style="font-weight:bold;background-color:#A0FFA0">[<I>Note:</I>
cv-qualification of a deduced function type is ignored; see
8.3.5 [dcl.fct]. &#8212;<I>end note</I>]</SPAN>
[<I>Example:</I></P>

<PRE>
  template&lt;class T&gt; void f(void(*)(T,int));
<SPAN style="font-weight:bold;background-color:#A0FFA0">  template&lt;class T&gt; void f2(const T*);</SPAN>
  template&lt;class T&gt; void foo(T,int);
  void g(int,int);
  void g(char,int);
<SPAN style="font-weight:bold;background-color:#A0FFA0">  void g2();</SPAN>

  void h(int,int,int);
  void h(char,int);
  int m() {
    f(&amp;g);     //<SPAN style="font-family:Times;font-style:italic"> error: ambiguous</SPAN>
    f(&amp;h);     //<SPAN style="font-family:Times;font-style:italic"> OK: </SPAN>void h(char,int)<SPAN style="font-family:Times;font-style:italic"> is a unique match</SPAN>
    f(&amp;foo);   //<SPAN style="font-family:Times;font-style:italic"> error: type deduction fails because </SPAN>foo<SPAN style="font-family:Times;font-style:italic"> is a template</SPAN>
<SPAN style="font-weight:bold;background-color:#A0FFA0">    f2(g2);    //<SPAN style="font-family:Times;font-style:italic"> OK: cv-qualification of deduced function type ignored</SPAN></SPAN>
  }
</PRE>

<P>&#8212;<I>end example</I>]</P>

</BLOCKQUOTE>

<P><B>Additional note, November, 2014:</B></P>

<P>Concern was expressed regarding the proposed resolution over its
treatment of an example like the following:</P>

<PRE>
  template&lt;typename T&gt; struct tuple_size {};
  template&lt;typename T&gt; struct tuple_size&lt;T const&gt;: tuple_size&lt;T&gt; {};

  tuple_size&lt;void()&gt; t;
</PRE>

<P>In this case <TT>T const</TT> is always considered to be more
specialized for <TT>void()</TT>, leading to infinite self-derivation.
</P>

<P>The issue has been returned to "open" status for further
consideration.</P>

<BR><BR><HR><A NAME="1221"></A><H4>1221.
  
Partial ordering and reference collapsing
</H4><B>Section: </B>14.8.2.4&#160; [temp.deduct.partial]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2010-11-08<BR>


<P>The current partial ordering rules produce surprising results in
the presence of reference collapsing. </P>

<P>Since partial ordering is currently based solely on the signature
of the function templates, the lack of difference following
substitution of the template type parameter in the following is not
taken into account.</P>

<P>Especially unsettling is that the allegedly "more specialized"
template (#2) is not a candidate in the first call where template
argument deduction fails for it despite a lack of non-deduced
contexts.</P>

<PRE>
    template &lt;typename T&gt;
    void foo(T&amp;&amp;);  // #1

    template &lt;typename T&gt;
    void foo(volatile T&amp;&amp;);  // #2

    int main(void) {
      const int x = 0;
      foo(x);  // calls #1 with T='const int &amp;'
      foo&lt;const int &amp;&gt;(x);  // calls #2
    }
</PRE>

<BR><BR><HR><A NAME="1763"></A><H4>1763.
  
Length mismatch in template type deduction
</H4><B>Section: </B>14.8.2.5&#160; [temp.deduct.type]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Canada
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-23<BR><BR>


<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3903.html#CA4">N3690 comment
  CA&#160;4<BR></A>

<P>It is not clear how an example like the following is to be handled:</P>

<PRE>
  template &lt;typename U&gt; 
  struct A { 
    template &lt;typename V&gt; operator A&lt;V&gt;(); 
  }; 

  template &lt;typename T&gt; 
  void foo(A&lt;void (T)&gt;); 

  void foo(); 

  int main() { 
    A&lt;void (int, char)&gt; a; 
    foo&lt;int&gt;(a); 
    foo(a); //<SPAN style="font-family:Times;font-style:italic"> deduces </SPAN>T<SPAN style="font-family:Times;font-style:italic"> to be </SPAN>int
  } 
</PRE>

<P>In subclause 14.8.2.5 [temp.deduct.type] paragraph 10, deduction from
a function type considers P/A pairs from the parameter-type-list only where
the "P" function type has a parameter.  Deduction is not specified to fail
if there are additional parameters in the corresponding "A" function
type.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>CWG agreed that this example should not be accepted.  The existing
rules seem to cover this case (deduction is not specified to
&#8220;succeed,&#8221; so it's a reasonable conclusion that it fails),
but it might be helpful to be clearer.</P>

<BR><BR><HR><A NAME="1946"></A><H4>1946.
  
<I>exception-specification</I>s vs pointer dereference
</H4><B>Section: </B>15.4&#160; [except.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-21<BR>


<P>The resolution of <A HREF="
     cwg_defects.html#1351">issue 1351</A> results
in the following:</P>

<PRE>
  void (*p)() throw(int);
  void (&amp;r)() throw(int) = *p;  //<SPAN style="font-family:Times;font-style:italic"> ill-formed</SPAN>
</PRE>

<P>The reason is that the set of potential exceptions for an
indirection is &#8220;any&#8221; instead of maintaining the known
potential exceptions of the operand.  It would seem to be reasonable
to propagate the set in such cases.</P>

<P>A similar issue arises with function template argument
deduction:</P>

<PRE>
  template&lt;typename T&gt; T&amp; f(T* p);
  void (*p)() throw(int);
  void (&amp;r)() throw(int) = f(p);  //<SPAN style="font-family:Times;font-style:italic"> ill-formed</SPAN>
</PRE>

<P>See also issues <A HREF="
     cwg_active.html#2010">2010</A>,
<A HREF="
     cwg_active.html#1995">1995</A>,
<A HREF="
     cwg_active.html#1975">1975</A>,
and <A HREF="
     cwg_closed.html#1798">1798</A>.</P>

<BR><BR><HR><A NAME="1995"></A><H4>1995.
  
<I>exception-specification</I>s and non-type template parameters
</H4><B>Section: </B>15.4&#160; [except.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Gabriel Dos Reis
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-03<BR>




<P>In the following example,</P>

<PRE>
   struct A {
     template&lt;class T&gt;
       T foo(T t) noexcept { return t; }
     };

     template&lt;class T, int (T::*fptr)(int)&gt; struct S {
       A a;
       S() noexcept(noexcept((a.*fptr)(1))) {}
     };

     int foo() {
       return noexcept(S&lt;A,&amp;A::foo&gt;());
     }
</PRE>

<P>what should <TT>foo</TT> return?  The question hinges upon whether
the <TT>noexcept</TT> property of the template argument is preserved
or lost in the process of substitution.</P>

<P>See also issues <A HREF="
     cwg_active.html#2010">2010</A>,
<A HREF="
     cwg_active.html#1975">1975</A>, <A HREF="
     cwg_active.html#1946">1946</A>,
and <A HREF="
     cwg_closed.html#1798">1798</A>.</P>

<BR><BR><HR><A NAME="2010"></A><H4>2010.
  
<I>exception-specification</I>s and conversion operators
</H4><B>Section: </B>15.4&#160; [except.spec]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-26<BR>




<P>It is not possible to provide an <I>exception-specification</I>
for a <I>conversion-type-id</I>, which prevents the result from
being used in assignment or initialization of a function pointer
with a non-throwing <I>exception-specification</I>.  This seems
unnecessarily restrictive.</P>

<P>See also issues <A HREF="
     cwg_active.html#1995">1995</A>,
<A HREF="
     cwg_active.html#1975">1975</A>, <A HREF="
     cwg_active.html#1946">1946</A>,
and <A HREF="
     cwg_closed.html#1798">1798</A>.</P>

<BR><BR><HR><A NAME="596"></A><H4>596.
  
Replacing an exception object
</H4><B>Section: </B>15.5.2&#160; [except.unexpected]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Alisdair Meredith
 &#160;&#160;&#160;

 <B>Date: </B>12 September 2006<BR>


<P>When a function throws an exception that is not in its
<I>exception-specification</I>, <TT>std::unexpected()</TT> is called.
According to 15.5.2 [except.unexpected] paragraph 2,</P>

<BLOCKQUOTE>

If [<TT>std::unexpected()</TT>] throws or rethrows an exception that
the <I>exception-specification</I> does not allow then the following
happens: If the <I>exception-specification</I> does not include the class
<TT>std::bad_exception</TT> (18.8.2 [bad.exception]) then
the function <TT>std::terminate()</TT> is called, otherwise the thrown
exception is replaced by an implementation-defined object of the type
<TT>std::bad_exception,</TT> and the search for another handler will
continue at the call of the function
whose <I>exception-specification</I> was violated.

</BLOCKQUOTE>

<P>The &#8220;replaced by&#8221; wording is imprecise and undefined.
For example, does this mean that the destructor is called for the
existing exception object, or is it simply abandoned?  Is the
replacement <I>in situ</I>, so that a pointer to the existing
exception object will now point to the <TT>std::bad_exception</TT>
object?</P>

<P><U>Mike Miller</U>: The call to <TT>std::unexpected()</TT> is
not described as analogous to invoking a handler, but if it were,
that would resolve this question; it is clearly specified what
happens to the previous exception object when a new exception is
thrown from a handler (15.1 [except.throw] paragraph 4).</P>

<P>This approach would also clarify other questions that have been
raised regarding the requirements for stack unwinding.  For
example, 15.5.1 [except.terminate] paragraph 2 says that</P>

<BLOCKQUOTE>

In the situation where no matching handler is found, it is
implementation-defined whether or not the stack is unwound before
<TT>std::terminate()</TT> is called.

</BLOCKQUOTE>

<P>This requirement could be viewed as in conflict with the statement
in 15.5.2 [except.unexpected] paragraph 1 that</P>

<BLOCKQUOTE>

If a function with an <I>exception-specification</I> throws an exception that
is not listed in the <I>exception-specification</I>, the function
<TT>std::unexpected()</TT> is called (D.8 [exception.unexpected])
immediately after completing the stack unwinding for the former
function.

</BLOCKQUOTE>

<P>If it is implementation-defined whether stack unwinding occurs before
calling <TT>std::terminate()</TT> and <TT>std::unexpected()</TT> is
called only after doing stack unwinding, does that mean that it is
implementation-defined whether <TT>std::unexpected()</TT> is called
if there is ultimately no handler found?</P>

<P>Again, if invoking <TT>std::unexpected()</TT> were viewed as
essentially invoking a handler, the answer to this would be clear,
because unwinding occurs before invoking a handler.</P>

<BR><BR><HR><A NAME="2034"></A><H4>2034.
  
Deprecating <TT>uncaught_exception()</TT>
</H4><B>Section: </B>15.5.3&#160; [except.uncaught]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>CWG
 &#160;&#160;&#160;

 <B>Date: </B>2014-11-06<BR>


<P>With the adoption of paper N4259 specifying the
<TT>std::uncaught_exceptions()</TT> function, the
<TT>std::uncaught_exception()</TT> function should be
deprecated.</P>

<BR><BR><HR><A NAME="2002"></A><H4>2002.
  
White space within preprocessing directives
</H4><B>Section: </B>16&#160; [cpp]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-10<BR>




<P>According to 16 [cpp] paragraphg 4,</P>

<BLOCKQUOTE>

The only white-space characters that shall appear between
preprocessing tokens within a preprocessing directive (from
just after the introducing <TT>#</TT> preprocessing token through
just before the terminating new-line character) are space
and horizontal-tab (including spaces that have replaced
comments or possibly other white-space characters in
translation phase 3).

</BLOCKQUOTE>

<P>The effect of this restriction is unclear, however, since
translation phase 3 is permitted to transform all white space
characters and comments into spaces.  The relationship between
these two rules should be clarified.</P>

<BR><BR><HR><A NAME="925"></A><H4>925.
  
Type of character literals in preprocessor expressions
</H4><B>Section: </B>16.1&#160; [cpp.cond]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>29 June, 2009<BR>


<P>According to 16.1 [cpp.cond] paragraph 4,</P>

<BLOCKQUOTE>

The resulting tokens comprise the controlling constant expression
which is evaluated according to the rules of 5.20 [expr.const]
using arithmetic that has at least the ranges specified in
18.3 [support.limits], except that all signed and unsigned integer
types act as if they have the same representation as, respectively,
<TT>intmax_t</TT> or <TT>uintmax_t</TT> (_N3035_.18.4.2 [stdinth]).
This includes interpreting character literals, which may involve
converting escape sequences into execution character set members.

</BLOCKQUOTE>

<P>Ordinary character literals with a single <I>c-char</I> have the
type <TT>char</TT>, which is neither a signed nor an unsigned integer
type. Although 4.5 [conv.prom] paragraph 1 is clear that
<TT>char</TT> values promote to <TT>int</TT>, regardless of whether
the implementation treats <TT>char</TT> as having the values of
<TT>signed char</TT> or <TT>unsigned char</TT>, 16.1 [cpp.cond] paragraph 4 isn't clear on whether character literals
should be treated as signed or unsigned values.  In C99, such
literals have type <TT>int</TT>, so the question does not arise.
If an implementation in which plain <TT>char</TT> has the values of
<TT>unsigned char</TT> were to treat character literals as unsigned,
an expression like <TT>'0'-'1'</TT> would thus have different values
in C and C++, namely -1 in C and some large unsigned value in C++.</P>

<BR><BR><HR><A NAME="1625"></A><H4>1625.
  
Adding spaces between tokens in stringizing
</H4><B>Section: </B>16.3.2&#160; [cpp.stringize]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Chandler Carruth
 &#160;&#160;&#160;

 <B>Date: </B>2013-02-18<BR>




<P>Given the following input,</P>

<PRE>
  #define F(A, B, C) A ## x.B ## y.C ## z
  #define STRINGIFY(x) #x
  #define EXPAND_AND_STRINGIFY(x) STRINGIFY(x)
  char v[] = EXPAND_AND_STRINGIFY(F(a, b, c))
</PRE>

<P>there is implementation variance in the value of <TT>v</TT>: some
produce the string <TT>"ax.by.cz"</TT> and others produce the string
<TT>"ax. by. cz"</TT>.  Although 16.3.2 [cpp.stringize] paragraph 2 is
explicit in its treatment of leading and trailing white space, it is not
clear whether there is latitude for inserting spaces between tokens, as
some implementations do, since the description otherwise is written solely
in terms of preprocessing tokens.  There may be cases in which such spaces
would be needed to preserve the original tokenization, but it is not clear
whether the result of stringization needs to produce something that would
lex to the same tokens.</P>

<P><B>Notes from the April, 2013 meeting:</B></P>

<P>Because the preprocessor specification is primarily copied directly
from the C Standard, this issue has been referred to the C liaison for
consultation with WG14.</P>

<BR><BR><HR><A NAME="268"></A><H4>268.
  
Macro name suppression in rescanned replacement text
</H4><B>Section: </B>16.3.4&#160; [cpp.rescan]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

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

 <B>Date: </B>18 Jan 2001<BR>




<P>It is not clear from the Standard what the result of the
following example should be:</P>

<BLOCKQUOTE>
<PRE>
#define NIL(xxx) xxx
#define G_0(arg) NIL(G_1)(arg)
#define G_1(arg) NIL(arg)
G_0(42)
</PRE>
</BLOCKQUOTE>

<P>The relevant text from the Standard is found in
16.3.4 [cpp.rescan] paragraph 2:</P>

<BLOCKQUOTE>

If the name of the macro being replaced is found during this scan of
the replacement list (not including the rest of the source file's
preprocessing tokens), it is not replaced. Further, if any nested
replacements encounter the name of the macro being replaced, it is not
replaced. These nonreplaced macro name preprocessing tokens are no
longer available for further replacement even if they are later
(re)examined in contexts in which that macro name preprocessing token
would otherwise have been replaced.

</BLOCKQUOTE>

<P>The sequence of expansion of <TT>G0(42)</TT> is as follows:</P>

<BLOCKQUOTE>
<PRE>
G0(42)
NIL(G_1)(42)
G_1(42)
NIL(42)
</PRE>
</BLOCKQUOTE>

<P>The question is whether the use of <TT>NIL</TT> in the last
line of this sequence qualifies for non-replacement under the
cited text.  If it does, the result will be <TT>NIL(42)</TT>.  If
it does not, the result will be simply <TT>42</TT>.</P>

<P>The original intent of the J11 committee in this text was
that the result should be <TT>42</TT>, as demonstrated by the
original pseudo-code description of the replacement algorithm
provided by Dave Prosser, its author.

The English description,
however, omits some of the subtleties of the pseudo-code and
thus arguably gives an incorrect answer for this case.</P>

<P><U>Suggested resolution (Mike Miller)</U>: Replace the cited
paragraph with the following:</P>

<BLOCKQUOTE>

<P>As long as the scan involves only preprocessing tokens from
a given macro's replacement list, or tokens resulting from a
replacement of those tokens, an occurrence of the macro's name
will not result in further replacement, even if it is later
(re)examined in contexts in which that macro name preprocessing
token would otherwise have been replaced.</P>

<P>Once the scan reaches the preprocessing token following a
macro's replacement list &#8212; including as part of the
argument list for that or another macro &#8212; the macro's
name is once again available for replacement.  [<I>Example:</I></P>

<PRE>
    #define NIL(xxx) xxx
    #define G_0(arg) NIL(G_1)(arg)
    #define G_1(arg) NIL(arg)
    G_0(42)                         // result is 42, not NIL(42)
</PRE>

<P>The reason that <TT>NIL(42)</TT> is replaced is that <TT>(42)</TT>
comes from outside the replacement list of <TT>NIL(G_1)</TT>, hence
the occurrence of <TT>NIL</TT> within the replacement list for
<TT>NIL(G_1)</TT> (via the replacement of <TT>G_1(42)</TT>) is not
marked as nonreplaceable.  <I>&#8212;end example</I>]</P>

</BLOCKQUOTE>

<P>(Note: The resolution of this issue must be coordinated with
J11/WG14.)</P>

<P><B>Notes (via Tom Plum) from April, 2004 WG14 Meeting:</B></P>

<P>Back in the 1980's it was understood by several WG14 people
that there were tiny differences between the "non-replacement"
verbiage and the attempts to produce pseudo-code.  The
committee's decision was that no realistic programs "in the wild"
would venture into this area, and trying to reduce the
uncertainties is not worth the risk of changing conformance
status of implementations or programs.</P>

<BR><BR><HR><A NAME="745"></A><H4>745.
  
Effect of ill-formedness resulting from <TT>#error</TT>
</H4><B>Section: </B>16.5&#160; [cpp.error]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Clark Nelson
 &#160;&#160;&#160;

 <B>Date: </B>13 November, 2008<BR>


<P>C99 is very clear that a <TT>#error</TT> directive causes a translation
to fail: Clause 4 paragraph 4 says,</P>

<BLOCKQUOTE>

The implementation shall not successfully translate a preprocessing
translation unit containing a <TT>#error</TT> preprocessing directive
unless it is part of a group skipped by conditional inclusion.

</BLOCKQUOTE>

<P>C++, on the other hand, simply says that a <TT>#error</TT> directive
&#8220;renders the program ill-formed&#8221; (16.5 [cpp.error]),
and the only requirement for an ill-formed program is that a diagnostic
be issued; the translation may continue and succeed.  (Noted in passing:
if this difference between C99 and C++ is addressed, it would be helpful
for synchronization purposes in other contexts as well to introduce the
term &#8220;preprocessing translation unit.&#8221;)</P>

<BR><BR><HR><A NAME="1889"></A><H4>1889.
  
Unclear effect of <TT>#pragma</TT> on conformance
</H4><B>Section: </B>16.6&#160; [cpp.pragma]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>James Widman
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-05<BR>




<P>According to 16.6 [cpp.pragma] paragraph 1, the effect of
a <TT>#pragma</TT> is to cause</P>

<BLOCKQUOTE>

the implementation to behave in an implementation-defined manner. The
behavior might cause translation to fail or cause the translator or the
resulting program to behave in a non-conforming manner.

</BLOCKQUOTE>

<P>It should be clarified that the extent of the non-conformance is
limited to the implementation-defined behavior.</P>

<BR><BR><HR><A NAME="897"></A><H4>897.
  
<TT>_Pragma</TT> and extended <I>string-literal</I>s
</H4><B>Section: </B>16.9&#160; [cpp.pragma.op]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>9 May, 2009<BR>




<P>The specification of how the <I>string-literal</I> in a <TT>_Pragma</TT>
operator is handled does not deal with the new kinds of string literals.
16.9 [cpp.pragma.op] says,</P>

<BLOCKQUOTE>

The string literal is <I>destringized</I> by deleting the <TT>L</TT>
prefix, if present, deleting the leading and trailing double-quotes,
replacing each escape sequence...

</BLOCKQUOTE>

<P>The various other prefixes should either be handled or prohibited.</P>



<P><B>Additional note (October, 2013):</B></P>

<P>If raw string literals are supported, the question of how to handle
line splicing is relevant.  The wording says that &#8220;the characters
are processed through translation phase 3,&#8221; which is a bit
ambiguous as to whether that includes phases 1 and 2 or not.  It would
be better to be explicit and say that the processing of phase 3 or of
phases 1 through 3 is applied.</P>

<BR><BR><HR><A NAME="1944"></A><H4>1944.
  
New C incompatibilities
</H4><B>Section: </B>C&#160; [diff]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-06-18<BR>


<P>Some new features of C++ not only introduce incompatibilities
with previous versions of C++ but also with C; however, the
organization of Annex C [diff] makes it difficult
to specify that a given feature is incompatible with both languages,
and the practice has been only to document the C++ incompatibilities.
Some means of specifying both sets of incompatibilities should be
found, hopefully without excessive duplication between the C and C++
sections.</P>

<BR><BR><HR><A NAME="1248"></A><H4>1248.
  
Updating Annex C to C99
</H4><B>Section: </B>C.1&#160; [diff.iso]
 &#160;&#160;&#160;

 <B>Status: </B>open
 &#160;&#160;&#160;

 <B>Submitter: </B>Jonathan Wakely
 &#160;&#160;&#160;

 <B>Date: </B>2011-02-28<BR>




<P>The description of incompatibilities with C in Annex
C.1 [diff.iso] refers to C89, but there are a number of
new features in C99 that should be covered.</P>



<BR><BR><BR><BR><HR><A NAME="Concurrency Status"></A><H3>Issues with "Concurrency" Status</H3>
<HR><A NAME="1661"></A><H4>1661.
  
Preservation of infinite loops
</H4><B>Section: </B>1.10&#160; [intro.multithread]
 &#160;&#160;&#160;

 <B>Status: </B>concurrency
 &#160;&#160;&#160;

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2013-04-15<BR>




<P>According to 1.10 [intro.multithread] paragraph 24,</P>

<BLOCKQUOTE>

<P>The implementation may assume that any thread will eventually do one of
the following:</P>

<UL><LI><P>terminate,</P></LI>

<LI><P>make a call to a library I/O function,</P></LI>

<LI><P>access or modify a volatile object, or</P></LI>

<LI><P>perform a synchronization operation or an atomic operation.</P></LI>

</UL>

<P>[<I>Note:</I> This is intended to allow compiler transformations such as
removal of empty loops, even when termination cannot be
proven. &#8212;<I>end note</I>]</P>

</BLOCKQUOTE>

<P>Some programmers find this liberty afforded to implementations to
be disadvantageous; see <A HREF="http://blog.regehr.org/archives/161">
this blog post</A> for a discussion of the subject.</P>

<BR><BR><HR><A NAME="1842"></A><H4>1842.
  
Unevaluated operands and &#8220;carries a dependency&#8221;
</H4><B>Section: </B>1.10&#160; [intro.multithread]
 &#160;&#160;&#160;

 <B>Status: </B>concurrency
 &#160;&#160;&#160;

 <B>Submitter: </B>Hans Boehm
 &#160;&#160;&#160;

 <B>Date: </B>2014-01-23<BR>


<P>According to 1.10 [intro.multithread] paragraph 9,</P>

<BLOCKQUOTE>

<P>An evaluation <I>A carries a dependency</I> to an evaluation <I>B</I>
if</P>

<UL><LI><P>the value of <I>A</I> is used as an operand of <I>B</I>,
unless:</P></LI>

<UL><LI><P>...</P></LI>

<LI><P><I>A</I> is the left operand of a built-in logical AND
(<TT>&amp;&amp;,</TT> see 5.14 [expr.log.and]) or logical OR
(<TT>||</TT>, see 5.15 [expr.log.or]) operator, or</P></LI>

<LI><P>...</P></LI>


</UL>

</UL>

</BLOCKQUOTE>

<P>The intent is that this does not apply to the second operands
of such operators if the first operand is such that they are not
evaluated, but the wording is not clear to that effect.  (A similar
question applies to the non-selected operand of the conditional
operator <TT>?:</TT>.)</P>

<BR><BR><HR><A NAME="1961"></A><H4>1961.
  
Potentially-concurrent actions within a signal handler
</H4><B>Section: </B>1.10&#160; [intro.multithread]
 &#160;&#160;&#160;

 <B>Status: </B>concurrency
 &#160;&#160;&#160;

 <B>Submitter: </B>Faisal Vali
 &#160;&#160;&#160;

 <B>Date: </B>2014-07-04<BR>




<P>According to 1.10 [intro.multithread] paragraph 23,</P>

<BLOCKQUOTE>

<P>Two actions are <I>potentially concurrent</I> if</P>

<UL><LI><P>they are performed by different threads, or</P></LI>

<LI><P>they are unsequenced, and at least one is performed by a
signal handler.</P></LI>

</UL>

</BLOCKQUOTE>

<P>This definition should exclude the case when both actions
are performed by a signal handler.</P>

<BR><BR><HR><A NAME="1784"></A><H4>1784.
  
Concurrent execution during static local initialization
</H4><B>Section: </B>6.7&#160; [stmt.dcl]
 &#160;&#160;&#160;

 <B>Status: </B>concurrency
 &#160;&#160;&#160;

 <B>Submitter: </B>Jens Maurer
 &#160;&#160;&#160;

 <B>Date: </B>2013-09-27<BR>


<P>Regarding initialization of a block-scope static variable,
6.7 [stmt.dcl] paragraph 4 says,</P>

<BLOCKQUOTE>

If control enters the declaration concurrently while the variable is being
initialized, the concurrent execution shall wait for completion of the
initialization.

</BLOCKQUOTE>

<P>This specification does not use the terminology of
1.10 [intro.multithread], so the meaning of &#8220;wait&#8221; is not
clear.  For example, will a concurrent thread that &#8220;waited&#8221;
see (in the sense of happens-before) the result of the initialization
(including side effects caused during the initialization)?</P>

<P>Perhaps the &#8220;synchronizes-with&#8221; terminology could be
used here.</P>

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