public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations
@ 2013-02-16 21:11 daniel.kruegler at googlemail dot com
  2013-02-20 12:09 ` [Bug c++/56358] " daniel.kruegler at googlemail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-02-16 21:11 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56358
           Summary: [C++11] Erroneous interaction of typedef and inherited
                    constructor declarations
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


The following code - compiled with the flags

-pedantic-errors -std=c++11 -Wall

is rejected by gcc 4.8.0 20130210 (experimental):

//----------------------------------
template<class T>
struct A {};

template<class T>
struct B1 : A<T> {
  typedef A<T> super_t;
  using A<T>::A; // #7
};

template<class T>
struct B2 : A<T> {
  using A<T>::A;
  typedef A<T> super_t; // #13
};
//----------------------------------

"7|error: declaration of 'using A<T>::A' [-fpermissive]|
2|error: changes meaning of 'A' from 'struct A<T>' [-fpermissive]|
13|error: 'A' does not name a type|
13|note: (perhaps 'typename A<T>::A' was intended)"

It could be related to bug 56323, but I have currently no way to verify this
hypotheses.

My understanding is that both definitions of B1 and B2 should be valid. Note
that even though the typedefs referring to A<T> are needed to produce the
error, even though at least in B1 its effects are completely unexpected.


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

* [Bug c++/56358] [C++11] Erroneous interaction of typedef and inherited constructor declarations
  2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
@ 2013-02-20 12:09 ` daniel.kruegler at googlemail dot com
  2013-02-20 12:16 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-02-20 12:09 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-02-20 12:09:13 UTC ---
As of the more recent trunk gcc 4.8.0 20130217 (experimental) these problems
have been partially reolved. Template B1 is now accepted, but template B2 still
causes problems. The reduced test case is:

//----------------------------------
template<class T>
struct A {};

template<class T>
struct B : A<T> {
  using A<T>::A;
  typedef A<T> super_t; // #7
};
//----------------------------------

"7|error: 'A' does not name a type|
7|note: (perhaps 'typename A<T>::A' was intended)"


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

* [Bug c++/56358] [C++11] Erroneous interaction of typedef and inherited constructor declarations
  2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
  2013-02-20 12:09 ` [Bug c++/56358] " daniel.kruegler at googlemail dot com
@ 2013-02-20 12:16 ` redi at gcc dot gnu.org
  2013-02-26 18:05 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2013-02-20 12:16 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-20
     Ever Confirmed|0                           |1


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

* [Bug c++/56358] [C++11] Erroneous interaction of typedef and inherited constructor declarations
  2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
  2013-02-20 12:09 ` [Bug c++/56358] " daniel.kruegler at googlemail dot com
  2013-02-20 12:16 ` redi at gcc dot gnu.org
@ 2013-02-26 18:05 ` jason at gcc dot gnu.org
  2013-02-27 18:14 ` jason at gcc dot gnu.org
  2013-02-27 18:16 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-26 18:05 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lucdanton at free dot fr

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2013-02-26 18:04:27 UTC ---
*** Bug 56452 has been marked as a duplicate of this bug. ***


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

* [Bug c++/56358] [C++11] Erroneous interaction of typedef and inherited constructor declarations
  2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
                   ` (2 preceding siblings ...)
  2013-02-26 18:05 ` jason at gcc dot gnu.org
@ 2013-02-27 18:14 ` jason at gcc dot gnu.org
  2013-02-27 18:16 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-27 18:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2013-02-27 18:13:36 UTC ---
Author: jason
Date: Wed Feb 27 18:13:24 2013
New Revision: 196316

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196316
Log:
    PR c++/56358
    PR c++/56323
    * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
    of the base name for inheriting ctors.
    (push_class_level_binding_1): Remove inheriting ctor handling.
    * pt.c (tsubst_decl) [USING_DECL]: Likewise.
    * class.c (add_implicitly_declared_members): Adjust.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/inh-ctor18.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/g++.dg/inherit/using5.C
    trunk/gcc/testsuite/g++.old-deja/g++.other/using3.C


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

* [Bug c++/56358] [C++11] Erroneous interaction of typedef and inherited constructor declarations
  2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
                   ` (3 preceding siblings ...)
  2013-02-27 18:14 ` jason at gcc dot gnu.org
@ 2013-02-27 18:16 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-27 18:16 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2013-02-27 18:15:02 UTC ---
Fixed.


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

end of thread, other threads:[~2013-02-27 18:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-16 21:11 [Bug c++/56358] New: [C++11] Erroneous interaction of typedef and inherited constructor declarations daniel.kruegler at googlemail dot com
2013-02-20 12:09 ` [Bug c++/56358] " daniel.kruegler at googlemail dot com
2013-02-20 12:16 ` redi at gcc dot gnu.org
2013-02-26 18:05 ` jason at gcc dot gnu.org
2013-02-27 18:14 ` jason at gcc dot gnu.org
2013-02-27 18:16 ` jason 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).