This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [wwwdocs] Add a case to porting_to + a question wrt validity of another one
- From: Jason Merrill <jason at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>, Nathan Sidwell <nathan at acm dot org>
- Date: Mon, 6 Feb 2017 13:03:54 -0500
- Subject: Re: [wwwdocs] Add a case to porting_to + a question wrt validity of another one
- Authentication-results: sourceware.org; auth=none
- References: <20170206171331.GB13736@redhat.com>
On Mon, Feb 6, 2017 at 12:13 PM, Marek Polacek <polacek@redhat.com> wrote:
> This patch adds a description of something I noticed while doing the
> Fedora mass rebuild. Do we want to say more about the invalidity of
> the incomplete type case?
Here's the relevant rule in the standard:
14.6/8: "If a hypothetical instantiation of a template immediately
following its definition would be ill-formed due to a construct that
does not depend on a template parameter, the program is ill-formed; no
diagnostic is required. If the interpretation of such a construct in
the hypothetical instantiation is different from the interpretation of
the corresponding construct in any actual instantiation of the
template, the program is ill-formed; no diagnostic is required. [
Note: This can happen in situations including the following:
* a type used in a non-dependent name is incomplete at the point at
which a template is defined but is complete at the point at which an
instantiation is performed, ...."
> Furthermore I noticed that the testcase below doesn't compile anymore since
> r240874; Nathan, is that desirable?
>
> class C {
> public:
> virtual ~C() noexcept(false);
> };
> class A : virtual C {
> virtual C m_fn1() = 0;
> };
> class B : A {};
>
> s.cc:8:7: error: looser throw specifier for ‘virtual B::~B() noexcept (false)’
> class B : A {};
> ^
> s.cc:5:7: error: overriding ‘virtual A::~A() noexcept’
> class A : virtual C {
> ^
No, this is a bug.
Jason