mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-20 17:44:53 +08:00
b7a89c041a
PR libstdc++/101236 shows that LLVM depends on being able to use unique_ptr<T[]>::operator[] when T is incomplete. This is undefined, but previously worked with libstdc++. When I added the conditional noexcept to that operator we started to diagnose the incomplete type. This change restores support for that case, by making the noexcept condition check that the type is complete before checking whether indexing on the pointer can throw. A workaround for PR c++/101239 is needed to avoid a bogus error where G++ fails to do SFINAE on the ill-formed p[n] expression and gets an ICE. Instead of checking that the p[n] expression is valid in the trailing-return-type, we only check that the element_type is complete. libstdc++-v3/ChangeLog: PR libstdc++/101236 * include/bits/unique_ptr.h (unique_ptr<T[], D>::operator[]): Fail gracefully if element_type is incomplete. * testsuite/20_util/unique_ptr/cons/incomplete.cc: Clarify that the standard doesn't require this test to work for array types. * testsuite/20_util/unique_ptr/lwg2762.cc: Check that incomplete types can be used with array specialization. * testsuite/20_util/unique_ptr/101236.cc: New test. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
ChangeLog-1998 | ||
ChangeLog-1999 | ||
ChangeLog-2000 | ||
ChangeLog-2001 | ||
ChangeLog-2002 | ||
ChangeLog-2003 | ||
ChangeLog-2004 | ||
ChangeLog-2005 | ||
ChangeLog-2006 | ||
ChangeLog-2007 | ||
ChangeLog-2008 | ||
ChangeLog-2009 | ||
ChangeLog-2010 | ||
ChangeLog-2011 | ||
ChangeLog-2012 | ||
ChangeLog-2013 | ||
ChangeLog-2014 | ||
ChangeLog-2015 | ||
ChangeLog-2016 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
ChangeLog-2020 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 | ||
Makefile.am | ||
Makefile.in | ||
README |
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.