[Bug libstdc++/71579] type_traits miss checks for type completeness in some traits

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 24 17:51:44 GMT 2020


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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:c1fc9f6e10e646f01194c8f150affbc1cfbc404a

commit r11-3442-gc1fc9f6e10e646f01194c8f150affbc1cfbc404a
Author: Antony Polukhin <antoshkka@gmail.com>
Date:   Thu Sep 24 18:51:37 2020 +0100

    libstdc++: assert that type traits are not misused with incomplete types
[PR 71579]

    libstdc++-v3/ChangeLog:

            PR libstdc++/71579
            * include/std/type_traits (invoke_result, is_invocable)
            (is_invocable_r, is_nothrow_invocable, is_nothrow_invocable_r):
            Add static_asserts to make sure that the arguments of the type
            traits are not misused with incomplete types.
            * testsuite/20_util/invoke_result/incomplete_args_neg.cc: New test.
            * testsuite/20_util/is_invocable/incomplete_args_neg.cc: New test.
            * testsuite/20_util/is_invocable/incomplete_neg.cc: New test.
            * testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc:
            New test.
            * testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc: Check
            for error on incomplete type usage in trait.


More information about the Gcc-bugs mailing list