[PR86397] resolve nondependent noexcept specs early in C++1[14]
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 6 Dec 2018 23:18:30 +0000 (23:18 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 6 Dec 2018 23:18:30 +0000 (23:18 +0000)
commit0d699def39bb937e3fddbd8149892594447b7f0d
treebc226370777bf810f190e77af3132a0a6126b99a
parent695be0923410ad753e9d7bc377f992406f904e94
[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.

From-SVN: r266874
gcc/cp/ChangeLog
gcc/cp/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr86397-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr86397-2.C [new file with mode: 0644]