This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37875] New: [c++0x] misinterpreted closing angle bracket in decltype operand
- From: "gcc-bugzilla at contacts dot eelis dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2008 11:12:06 -0000
- Subject: [Bug c++/37875] New: [c++0x] misinterpreted closing angle bracket in decltype operand
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I think g++ incorrectly rejects the following code when compiled with
-std=c++0x:
template <typename> struct X {};
X<decltype(1 > 2)> x;
// t.cpp:2: error: template argument 1 is invalid
// t.cpp:2: error: invalid type in declaration before ?;? token
For comparison, here is very similar code that is accepted:
template <int> struct Y {};
Y<sizeof(1 > 2)> y;
Hence, I suspect it is a problem with decltype.
--
Summary: [c++0x] misinterpreted closing angle bracket in decltype
operand
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc-bugzilla at contacts dot eelis dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37875