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

--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Author: aoliva
Date: Thu Dec  6 23:18:30 2018
New Revision: 266874

URL: https://gcc.gnu.org/viewcvs?rev=266874&root=gcc&view=rev
Log:
[PR86397] resolve nondependent noexcept specs early in C++1[14]

build_noexcept_spec refrained from resolving nondependent noexcept
expressions when they were not part of the function types (C++ 11 and
14).  This caused problems during mangling: canonical_eh_spec, when
called on the template function type, would find an unresolved but not
explicitly deferred expression, and nothrow_spec_p would reject it.

We could relax the mangling logic to skip canonical_eh_spec, but since
-Wnoexcept-type warns when mangling function names that change as
noexcept specs become part of types and of mangling in C++17, and the
test at mangling time may give incorrect results if the spec is not
resolved, we might as well keep things simple and resolve nondependent
noexcept specs sooner rather than later.  This is what this patch does.


for  gcc/cp/ChangeLog

        PR c++/86397
        * except.c (build_noexcept_spec): Resolve nondependent
        expressions.

for gcc/testsuite/ChangeLog

        PR c++/86397
        * g++.dg/cpp0x/pr86397-1.C: New.
        * g++.dg/cpp0x/pr86397-2.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr86397-1.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr86397-2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/except.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to