This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51666] New: NSDMI parse fails for template'd intializer
- From: "miles at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Dec 2011 14:15:32 +0000
- Subject: [Bug c++/51666] New: NSDMI parse fails for template'd intializer
- Auto-submitted: auto-generated
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