public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63339] New: "using constructors" from virtual bases are implicitly deleted
@ 2014-09-23  6:47 jobnoorman at gmail dot com
  0 siblings, 0 replies; only message in thread
From: jobnoorman at gmail dot com @ 2014-09-23  6:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63339

            Bug ID: 63339
           Summary: "using constructors" from virtual bases are implicitly
                    deleted
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jobnoorman at gmail dot com

GCC implicitly deletes constructors pulled from a virtual base class with a
"using" directive. The error indicates GCC thinks the default definition would
be ill-formed.

Although I'm not completely sure this is a bug, I'm filing it as such since a
quick skim through section 7.3.4 and 12.9 of N3337 revealed no reason why
"using" a constructor from a virtual base should be disallowed. Also, Clang
compiles the example code just fine.

Here is a small piece of code that reproduces this issue:

struct A
{
    A(int i) {}
};

struct B : virtual A
{
    using A::A;
};

void f()
{
    B b{5};
}

And the error produced by GCC:

$ g++-4.9 -c -std=c++11 test.cpp
test.cpp: In function ‘void f()’:
test.cpp:13:10: error: use of deleted function ‘B::B(int)’
     B b{5};
          ^
test.cpp:8:14: note: ‘B::B(int)’ is implicitly deleted because the default
definition would be ill-formed:
     using A::A;
              ^
test.cpp:8:14: error: no matching function for call to ‘A::A()’
test.cpp:8:14: note: candidates are:
test.cpp:3:5: note: A::A(int)
     A(int i) {}
     ^
test.cpp:3:5: note:   candidate expects 1 argument, 0 provided
test.cpp:1:8: note: constexpr A::A(const A&)
 struct A
        ^
test.cpp:1:8: note:   candidate expects 1 argument, 0 provided
test.cpp:1:8: note: constexpr A::A(A&&)
test.cpp:1:8: note:   candidate expects 1 argument, 0 provided

Further information:
$ g++-4.9 -v
Using built-in specs.
COLLECT_GCC=g++-4.9
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.9.1-3ubuntu2~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.1 (Ubuntu 4.9.1-3ubuntu2~14.04.1)
>From gcc-bugs-return-462308-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 23 06:53:45 2014
Return-Path: <gcc-bugs-return-462308-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2491 invoked by alias); 23 Sep 2014 06:53:45 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2443 invoked by uid 48); 23 Sep 2014 06:53:42 -0000
From: "jobnoorman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63339] "using constructors" from virtual bases are implicitly deleted
Date: Tue, 23 Sep 2014 06:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jobnoorman at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-63339-4-CxBN0eLmmE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63339-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63339-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg02142.txt.bz2
Content-length: 503

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc339

Job Noorman <jobnoorman at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Job Noorman <jobnoorman at gmail dot com> ---
Duplicate of 58751.

*** This bug has been marked as a duplicate of bug 58751 ***


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-23  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23  6:47 [Bug c++/63339] New: "using constructors" from virtual bases are implicitly deleted jobnoorman at gmail dot com

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