This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42603] New: decltype not supported for parent class specifier
- From: "gccbugs at blaggart dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2010 05:23:58 -0000
- Subject: [Bug c++/42603] New: decltype not supported for parent class specifier
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
file: test.cpp
template <class T>
T make();
struct p {};
struct c : decltype(make<p>()) {};
compilation command:
g++ -c -std=c++0x test.cpp
output:
test.cpp:5: error: expected class-name before 'decltype'
test.cpp:5: error: expected '{' before 'decltype'
test.cpp:5: error: expected unqualified-id before '{' token
Expected result:
c should inherit p and everything should compile fine.
Note that this can be worked around with the following modification:
template <class T>
T make();
template <class T> struct wrap {
typedef T type;
};
struct p {};
struct c : wrap< decltype(make<p>()) >::type {};
However this modification is cumbersome and seems pointless.
--
Summary: decltype not supported for parent class specifier
Product: gcc
Version: 4.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gccbugs at blaggart dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42603