This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70077] New: noexcept, inheriting constructors and the invalid use of an incomplete type that is actually complete
- From: "michele.caini at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Mar 2016 08:46:15 +0000
- Subject: [Bug c++/70077] New: noexcept, inheriting constructors and the invalid use of an incomplete type that is actually complete
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70077
Bug ID: 70077
Summary: noexcept, inheriting constructors and the invalid use
of an incomplete type that is actually complete
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: michele.caini at gmail dot com
Target Milestone: ---
The following code does not compile:
struct B {
B(int) noexcept { }
virtual void f() = 0;
};
struct D: public B {
using B::B;
D() noexcept(noexcept(D{42})): B{42} { }
void f() override { }
};
int main() {
B *b = new D{};
}
The error output is as follows:
test.cpp:8:31: error: invalid use of incomplete type âstruct Dâ
D() noexcept(noexcept(D{42})): B{42} { }
Anyway, the type D is actually a complete type and the noexcept should work as
expected.
Other version of GCC works fine indeed, see
http://coliru.stacked-crooked.com/a/fdbd0c1c70e74f64 as an example.