c++: traits, array of unknown bound of incomplete
commitfcff9a464cc10eadc60616990c128717ba5ac9eb
authorJason Merrill <jason@redhat.com>
Wed, 23 Mar 2022 16:25:18 +0000 (23 12:25 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 29 Apr 2022 03:02:11 +0000 (28 23:02 -0400)
tree3b8f54a03064c1778ddd5aed5c89900a88c54351
parent97b30a399ef561f6f37a2c08c830fdf3141bb504
c++: traits, array of unknown bound of incomplete

My r161129 changed check_trait_type to reject arrays of unknown bound of
incomplete type, but I can't find a rationale for that, and now think it's
wrong: the standard just requires that the type be "complete, cv void, or an
array of unknown bound."  I imagine that allowing arrays of unknown bound is
because an array of unknown bound can't change from incomplete to complete
later in the translation unit, so there's no caching problem.

gcc/cp/ChangeLog:

* semantics.cc (check_trait_type): Don't check completeness
of element type of array of unknown bound.

gcc/testsuite/ChangeLog:

* g++.dg/ext/unary_trait_incomplete.C: Adjust.
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C