public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51139] New: c++11 alias-declarations doasn't work contrary to relase notes
@ 2011-11-15 11:34 sp at comsulting dot de
  2011-11-15 11:37 ` [Bug c++/51139] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sp at comsulting dot de @ 2011-11-15 11:34 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-15 12:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-15 11:34 [Bug c++/51139] New: c++11 alias-declarations doasn't work contrary to relase notes sp at comsulting dot de
2011-11-15 11:37 ` [Bug c++/51139] " redi at gcc dot gnu.org
2011-11-15 11:43 ` redi at gcc dot gnu.org
2011-11-15 12:20 ` sp at comsulting dot de
2011-11-15 12:31 ` sp at comsulting dot de
2011-11-15 12:48 ` redi at gcc dot gnu.org
2011-11-15 13:13 ` sp at comsulting dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).