public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14007] New: Incorrect use of const partial specialization for reference template argument
@ 2004-02-03 19:57 austern at apple dot com
  2004-02-03 20:17 ` [Bug c++/14007] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: austern at apple dot com @ 2004-02-03 19:57 UTC (permalink / raw)
  To: gcc-bugs

Consider the following test program:
    #include <stdio.h>
    
    template <class T> struct X          { enum { val = 0 }; };
    template <class T> struct X<const T> { enum { val = 1 }; };
    
    int main() {
      printf("%d\n", X<int&>::val);
    }

The value printed is "1".  That is, the 3.x compiler (tested with 3.1, 3.3, and mainline) thinks that 
X<int&> refers to the X<const T> partial specialization rather than to the primary template.

I believe that this is wrong.  The partial specialization should only be used for a type that has a 
top-level const qualifier, and references are not cv-qualified.  (8.3.2, paragraph 1).

This is a regression from 2.95.

-- 
           Summary: Incorrect use of const partial specialization for
                    reference template argument
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.2.0
  GCC host triplet: powerpc-apple-darwin7.2.0
GCC target triplet: powerpc-apple-darwin7.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14007


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2004-07-01 21:00 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-03 19:57 [Bug c++/14007] New: Incorrect use of const partial specialization for reference template argument austern at apple dot com
2004-02-03 20:17 ` [Bug c++/14007] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-03 20:22 ` bangerth at dealii dot org
2004-02-03 20:26 ` pinskia at gcc dot gnu dot org
2004-02-15 12:45 ` gdr at gcc dot gnu dot org
2004-03-17  3:13 ` mmitchel at gcc dot gnu dot org
2004-03-17 18:23 ` austern at apple dot com
2004-03-17 19:02 ` nathan at codesourcery dot com
2004-03-19 14:27 ` nathan at gcc dot gnu dot org
2004-03-19 17:34 ` mmitchel at gcc dot gnu dot org
2004-03-19 17:39 ` gdr at integrable-solutions dot net
2004-03-19 18:12 ` austern at apple dot com
2004-03-19 18:19 ` pinskia at gcc dot gnu dot org
2004-03-19 18:20 ` pinskia at gcc dot gnu dot org
2004-04-02 10:07 ` nathan at gcc dot gnu dot org
2004-04-02 11:49 ` cvs-commit at gcc dot gnu dot org
2004-04-02 12:07 ` nathan at gcc dot gnu dot org
2004-04-02 12:10 ` giovannibajo at libero dot it
2004-04-02 15:13 ` [Bug c++/14007] [3.3/3.4 " gdr at integrable-solutions dot net
2004-04-02 15:29 ` nathan at gcc dot gnu dot org
2004-04-02 16:59 ` mmitchel at gcc dot gnu dot org
2004-04-02 17:39 ` bangerth at dealii dot org
2004-04-03 12:38 ` gdr at integrable-solutions dot net
2004-06-12 21:53 ` mmitchel at gcc dot gnu dot org
2004-06-13 10:02 ` nathan at gcc dot gnu dot org
2004-06-18 23:54 ` mmitchel at gcc dot gnu dot org
2004-06-19  9:00 ` nathan at gcc dot gnu dot org
2004-06-19 17:39 ` mark at codesourcery dot com
2004-06-21 12:46 ` cvs-commit at gcc dot gnu dot org
2004-06-21 12:46 ` nathan at gcc dot gnu dot org
2004-07-01 20:58 ` andreas dot meier_ at gmx dot de
2004-07-01 21:00 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).