public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52465] New: g++ rejects valid code with in-class using declaration
@ 2012-03-03  9:52 vanboxem.ruben at gmail dot com
  2012-03-03 10:10 ` [Bug c++/52465] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2012-03-03  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52465
           Summary: g++ rejects valid code with in-class using declaration
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vanboxem.ruben@gmail.com


This code is rejected by GCC 4.7 (built 2/25), but accepted by everything else:

class A
{
protected:
  struct B {};
};

class C : A
{
protected:
  using A::B;

  struct D : public B {};
};

This prevents WebKit compilation where a similar construct is used.


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

* [Bug c++/52465] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
@ 2012-03-03 10:10 ` jakub at gcc dot gnu.org
  2012-03-03 22:31 ` [Bug c++/52465] [4.7 regression] " jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-03 10:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-03 10:10:05 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181359
Whether the code is valid or not I'll leave to Jason.


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

* [Bug c++/52465] [4.7 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
  2012-03-03 10:10 ` [Bug c++/52465] " jakub at gcc dot gnu.org
@ 2012-03-03 22:31 ` jason at gcc dot gnu.org
  2012-03-04 18:42 ` fabien at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-03-03 22:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-03
                 CC|                            |fabien at gcc dot gnu.org
            Summary|g++ rejects valid code with |[4.7 regression] g++
                   |in-class using declaration  |rejects valid code with
                   |                            |in-class using declaration
     Ever Confirmed|0                           |1

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-03-03 22:30:55 UTC ---
Yes, that's valid.  Fabien, can you take a look?


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

* [Bug c++/52465] [4.7 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
  2012-03-03 10:10 ` [Bug c++/52465] " jakub at gcc dot gnu.org
  2012-03-03 22:31 ` [Bug c++/52465] [4.7 regression] " jason at gcc dot gnu.org
@ 2012-03-04 18:42 ` fabien at gcc dot gnu.org
  2012-03-04 21:52 ` fabien at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-03-04 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

fabien at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from fabien at gcc dot gnu.org 2012-03-04 18:42:28 UTC ---
(In reply to comment #2)
> Yes, that's valid.  Fabien, can you take a look?

Yes, of course.


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

* [Bug c++/52465] [4.7 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (2 preceding siblings ...)
  2012-03-04 18:42 ` fabien at gcc dot gnu.org
@ 2012-03-04 21:52 ` fabien at gcc dot gnu.org
  2012-03-08 20:41 ` fabien at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-03-04 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from fabien at gcc dot gnu.org 2012-03-04 21:52:15 UTC ---
This is because some USING_DECLs are stored in IDENTIDIER_BINDINGs. Jason, do
you agree that cxx_binding->value and cxx_binding->type should not be
USING_DECLs ?


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

* [Bug c++/52465] [4.7 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (3 preceding siblings ...)
  2012-03-04 21:52 ` fabien at gcc dot gnu.org
@ 2012-03-08 20:41 ` fabien at gcc dot gnu.org
  2012-04-05 10:53 ` [Bug c++/52465] [4.7/4.8 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-03-08 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

fabien at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |fabien at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from fabien at gcc dot gnu.org 2012-03-08 20:41:06 UTC ---
(In reply to comment #4)
> This is because some USING_DECLs are stored in IDENTIDIER_BINDINGs. Jason, do
> you agree that cxx_binding->value and cxx_binding->type should not be
> USING_DECLs ?

Nonsense, it cannot works. I am testing a patch...


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

* [Bug c++/52465] [4.7/4.8 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (4 preceding siblings ...)
  2012-03-08 20:41 ` fabien at gcc dot gnu.org
@ 2012-04-05 10:53 ` rguenth at gcc dot gnu.org
  2012-04-11 20:41 ` fabien at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-05 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.1
            Summary|[4.7 regression] g++        |[4.7/4.8 regression] g++
                   |rejects valid code with     |rejects valid code with
                   |in-class using declaration  |in-class using declaration


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

* [Bug c++/52465] [4.7/4.8 regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (5 preceding siblings ...)
  2012-04-05 10:53 ` [Bug c++/52465] [4.7/4.8 " rguenth at gcc dot gnu.org
@ 2012-04-11 20:41 ` fabien at gcc dot gnu.org
  2012-04-13 12:57 ` [Bug c++/52465] [4.7 Regression] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-04-11 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from fabien at gcc dot gnu.org 2012-04-11 20:40:58 UTC ---
Author: fabien
Date: Wed Apr 11 20:40:51 2012
New Revision: 186355

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186355
Log:
gcc/testsuite/ChangeLog

2012-04-09  Fabien Chêne  <fabien@gcc.gnu.org>

    PR c++/52465
    * g++.dg/lookup/using52.C: New.

gcc/cp/ChangeLog

2012-04-09  Fabien Chêne  <fabien@gcc.gnu.org>

    PR c++/52465
    * parser.c (cp_parser_class_name): Call strip_using_decl and
    return the target decl.
    * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
    to be stripped is NULL_TREE.
    (qualify_lookup): Call strip_using_decl and perform some checks on
    the target decl.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/using52.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/52465] [4.7 Regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (6 preceding siblings ...)
  2012-04-11 20:41 ` fabien at gcc dot gnu.org
@ 2012-04-13 12:57 ` rguenth at gcc dot gnu.org
  2012-04-15 20:23 ` fabien at gcc dot gnu.org
  2012-04-15 20:25 ` fabien at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-13 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
      Known to work|                            |4.8.0
            Summary|[4.7/4.8 regression] g++    |[4.7 Regression] g++
                   |rejects valid code with     |rejects valid code with
                   |in-class using declaration  |in-class using declaration

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-13 12:56:24 UTC ---
Fixed on trunk sofar.


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

* [Bug c++/52465] [4.7 Regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (7 preceding siblings ...)
  2012-04-13 12:57 ` [Bug c++/52465] [4.7 Regression] " rguenth at gcc dot gnu.org
@ 2012-04-15 20:23 ` fabien at gcc dot gnu.org
  2012-04-15 20:25 ` fabien at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-04-15 20:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from fabien at gcc dot gnu.org 2012-04-15 20:22:47 UTC ---
Author: fabien
Date: Sun Apr 15 20:22:44 2012
New Revision: 186473

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186473
Log:
2012-04-15  Fabien Chêne  <fabien@gcc.gnu.org>

    PR c++/52465
    * g++.dg/lookup/using52.C: New.

gcc/cp/ChangeLog

2012-04-15  Fabien Chêne  <fabien@gcc.gnu.org>

    PR c++/52465
    * parser.c (cp_parser_class_name): Call strip_using_decl and
    return the target decl.
    * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
    to be stripped is NULL_TREE.
    (qualify_lookup): Call strip_using_decl and perform some checks on
    the target decl.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/lookup/using52.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/name-lookup.c
    branches/gcc-4_7-branch/gcc/cp/parser.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/52465] [4.7 Regression] g++ rejects valid code with in-class using declaration
  2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
                   ` (8 preceding siblings ...)
  2012-04-15 20:23 ` fabien at gcc dot gnu.org
@ 2012-04-15 20:25 ` fabien at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-04-15 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

fabien at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from fabien at gcc dot gnu.org 2012-04-15 20:25:23 UTC ---
Fixed in 4.7.1 and on trunk.


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

end of thread, other threads:[~2012-04-15 20:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03  9:52 [Bug c++/52465] New: g++ rejects valid code with in-class using declaration vanboxem.ruben at gmail dot com
2012-03-03 10:10 ` [Bug c++/52465] " jakub at gcc dot gnu.org
2012-03-03 22:31 ` [Bug c++/52465] [4.7 regression] " jason at gcc dot gnu.org
2012-03-04 18:42 ` fabien at gcc dot gnu.org
2012-03-04 21:52 ` fabien at gcc dot gnu.org
2012-03-08 20:41 ` fabien at gcc dot gnu.org
2012-04-05 10:53 ` [Bug c++/52465] [4.7/4.8 " rguenth at gcc dot gnu.org
2012-04-11 20:41 ` fabien at gcc dot gnu.org
2012-04-13 12:57 ` [Bug c++/52465] [4.7 Regression] " rguenth at gcc dot gnu.org
2012-04-15 20:23 ` fabien at gcc dot gnu.org
2012-04-15 20:25 ` fabien at gcc dot gnu.org

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).