[Bug c++/14258] typename in a using declaration not supported

2014-01-22 Thread pipping at exherbo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

Elias Pipping pipping at exherbo dot org changed:

   What|Removed |Added

 CC||pipping at exherbo dot org

--- Comment #18 from Elias Pipping pipping at exherbo dot org ---
I'm a bit confused here. Please consider the following piece of code:

SNIP

template typename T struct A {
  typedef int type;
};

template typename T struct B : public AT {
  using typename AT::type;
  static const int block_size = type::block_size;
};

SNAP

Compiling it with gcc 4.8.2 yields

  foo.hh:9:33: error: ‘type’ is not a class, namespace, or enumeration

whereas clang 3.4 will happily accept it(*).

At a first glance, this bug appears to address issues such as this, so that gcc
4.8.2 should be fine. This does not seem to be the case, however -- the test
case provided by Jim Apple compiles but the one above does not; I'll have to
assume the bug was only partly fixed?


(*) I orginally thought this was not valid and filed a clang bug:
http://llvm.org/bugs/show_bug.cgi?id=18574

[Bug c++/14258] typename in a using declaration not supported

2014-01-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

--- Comment #19 from Jonathan Wakely redi at gcc dot gnu.org ---
That example's a bit misleading, because 'int' really isn't a class, namespace
or enumeration, but the error's wrong because there could be a specialization
of A, and the same error is produced even if AT::type is a class type.

Fabien, the fix doesn't seem to work with nested-name-specifiers, do you
remember if there's another bug report about that case?


[Bug c++/14258] typename in a using declaration not supported

2014-01-22 Thread fabien at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

--- Comment #20 from fabien at gcc dot gnu.org ---
(In reply to Jonathan Wakely from comment #19)

 Fabien, the fix doesn't seem to work with nested-name-specifiers, do you
 remember if there's another bug report about that case?

Yes, it's probably PR58047.


[Bug c++/14258] typename in a using declaration not supported

2014-01-22 Thread pipping at exherbo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

--- Comment #21 from Elias Pipping pipping at exherbo dot org ---
(In reply to Jonathan Wakely from comment #19)
 That example's a bit misleading, because 'int' really isn't a class,
 namespace or enumeration, but the error's wrong because there could be a
 specialization of A, and the same error is produced even if AT::type is
 a class type.

You're right. This will reproduce the problem, too:

SNIP

struct C;

template typename T struct A {
  typedef C type;
};

template typename T struct B : public AT {
  using typename AT::type;
  static const int block_size = type::block_size;
};

SNAP


[Bug c++/14258] typename in a using declaration not supported

2014-01-22 Thread pipping at exherbo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

--- Comment #22 from Elias Pipping pipping at exherbo dot org ---
I guess my test case is a reduction/duplicate of PR37140.


[Bug c++/14258] typename in a using declaration not supported

2012-03-19 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 CC||akim.demaille at gmail dot
   ||com

--- Comment #17 from Jonathan Wakely redi at gcc dot gnu.org 2012-03-19 
16:31:04 UTC ---
*** Bug 52620 has been marked as a duplicate of this bug. ***


[Bug c++/14258] typename in a using declaration not supported

2012-01-03 Thread fabien at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

fabien at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.7.0


[Bug c++/14258] typename in a using declaration not supported

2011-12-13 Thread fabien at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

--- Comment #15 from fabien at gcc dot gnu.org 2011-12-13 18:47:04 UTC ---
Author: fabien
Date: Tue Dec 13 18:46:58 2011
New Revision: 182292

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=182292
Log:
gcc/testsuite/ChangeLog

2011-12-11  Fabien Chene  fab...@gcc.gnu.org

PR c++/14258
* g++.dg/template/using16.C: New.
* g++.dg/template/using17.C: New.

gcc/cp/ChangeLog

2011-12-11  Fabien Chene  fab...@gcc.gnu.org

PR c++/14258
* cp-tree.h (USING_DECL_TYPENAME_P): New macro.
* parser.c (cp_parser_nonclass_name): Handle using declarations
that refer to a dependent type.
(cp_parser_using_declaration): Set USING_DECL_TYPENAME_P to 1 if
the using declaration refers to a dependent type.

Added:
trunk/gcc/testsuite/g++.dg/template/using16.C
trunk/gcc/testsuite/g++.dg/template/using17.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/14258] typename in a using declaration not supported

2011-12-13 Thread fabien at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

fabien at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
  Known to fail||

--- Comment #16 from fabien at gcc dot gnu.org 2011-12-13 19:29:26 UTC ---
Fixed.


[Bug c++/14258] typename in a using declaration not supported

2010-12-01 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ian at airs dot com

--- Comment #14 from Andrew Pinski pinskia at gcc dot gnu.org 2010-12-01 
15:46:29 UTC ---
*** Bug 46748 has been marked as a duplicate of this bug. ***


[Bug c++/14258] typename in a using declaration not supported

2010-11-29 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ilpoilves at hotmail dot
   ||com

--- Comment #13 from Andrew Pinski pinskia at gcc dot gnu.org 2010-11-29 
19:13:27 UTC ---
*** Bug 46690 has been marked as a duplicate of this bug. ***


[Bug c++/14258] typename in a using declaration not supported

2010-06-07 Thread fabien at gcc dot gnu dot org


-- 

fabien at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |fabien at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2006-09-03 21:39:11 |2010-06-07 12:43:20
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258



[Bug c++/14258] typename in a using declaration not supported

2008-08-16 Thread pinskia at gcc dot gnu dot org


--- Comment #12 from pinskia at gcc dot gnu dot org  2008-08-16 20:03 
---
*** Bug 37141 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||joao dot eiras at gmail dot
   ||com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258



[Bug c++/14258] typename in a using declaration not supported

2008-02-16 Thread starlight at binnacle dot cx


--- Comment #11 from starlight at binnacle dot cx  2008-02-16 19:28 ---
Also fails with GCC 4.2.3.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258



[Bug c++/14258] typename in a using declaration not supported

2007-05-07 Thread rleigh at debian dot org


--- Comment #10 from rleigh at debian dot org  2007-05-07 13:04 ---
Also fails with GCC 4.1.3.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258



[Bug c++/14258] typename in a using declaration not supported

2007-05-06 Thread pinskia at gcc dot gnu dot org


--- Comment #9 from pinskia at gcc dot gnu dot org  2007-05-06 23:31 ---
*** Bug 15260 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jbeulich at novell dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258



[Bug c++/14258] typename in a using declaration not supported

2005-05-10 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-10 
17:42 ---
*** Bug 21484 has been marked as a duplicate of this bug. ***

-- 
   What|Removed |Added

 CC||smelkov at mph1 dot phys dot
   ||spbu dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258


[Bug c++/14258] typename in a using declaration not supported

2004-11-18 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-18 
12:25 ---
*** Bug 18541 has been marked as a duplicate of this bug. ***

-- 
   What|Removed |Added

 CC||igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14258