This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51139] New: c++11 alias-declarations doasn't work contrary to relase notes
- From: "sp at comsulting dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Nov 2011 11:14:20 +0000
- Subject: [Bug c++/51139] New: c++11 alias-declarations doasn't work contrary to relase notes
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51139
Bug #: 51139
Summary: c++11 alias-declarations doasn't work contrary to
relase notes
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sp@comsulting.de
According to the 4.7 release notes (http://gcc.gnu.org/gcc-4.7/changes.html)
the C++11 feature "alias-declarations" should work.
However I was not able to compile the example given in the release notes above:
-------------------------------------
template <class T> using Ptr = T*;
Ptr<int> ip; // decltype(ip) is int*
-------------------------------------
I get this error:
---------------------------------------------
error: expected unqualified-id before 'using'
error: 'Ptr' does not name a type
---------------------------------------------
I tried the other C++11 examples like
--------------------------------------------------------------------------------
constexpr long double operator"" _degrees (long double d) { return d * 0.0175;
}
long double pi = 180_degrees;
--------------------------------------------------------------------------------
and
-----------------------------
struct A {
int i = 42;
} a; // initializes a.i to 42
-----------------------------
which all work fine.
This is the output of the version information:
-----------------------------------
/opt/gcc-4.7/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-4.7/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc-4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/opt/gcc-4.7 --enable-languages=c,c++
--enable-threads=posix --enable-tls --enable-libgomp --enable-lto --disable-nls
--disable-checking --disable-multilib --disable-bootstrap
Thread model: posix
gcc version 4.7.0 20111105 (experimental) (GCC)
------------------------------------
It's an ubuntu system (11.10 64Bit). I compiled the gcc from the then newest
snapshot.