]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR86397] resolve nondependent noexcept specs early in C++1[14]
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2018 23:18:30 +0000 (23:18 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2018 23:18:30 +0000 (23:18 +0000)
commitbcb39cf3aebfb615fec0639e7b55aad9d3b6e1f6
treebc226370777bf810f190e77af3132a0a6126b99a
parentc1212d8d1ae719996123b2ea2aca2cd3ffc8a492
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266874 138bc75d-0d04-0410-961f-82ee72b054a4
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]