This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51666] New: NSDMI parse fails for template'd intializer


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

             Bug #: 51666
           Summary: NSDMI parse fails for template'd intializer
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: miles@gnu.org


The following code:

   template<typename T, typename U>
   struct tuple
   {
     tuple(T, U) { }
   };

   struct Y
   {
     tuple<int, int> tt = tuple<int, int>{1, 2};   // *error*
   };

Fails with a parse error in gcc 4.7 20111210:

   $ g++-snapshot -c -std=c++11 nsdmi3.cc
   nsdmi3.cc:9:36: error: expected unqualified-id before 'int'
   nsdmi3.cc:9:31: error: wrong number of template arguments (1, should be 2)
   nsdmi3.cc:2:9: error: provided for 'template<class T, class U> struct tuple'

   $ g++-snapshot --version
   g++ (Debian 20111210-1) 4.7.0 20111210 (experimental) [trunk revision
182188]

Thanks,

-miles


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]