[Bug libstdc++/79433] __has_include(<new header>) is true but #include <new header> gives #error when -std=old

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 20 15:15:00 GMT 2017


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

--- Comment #27 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Fri Oct 20 15:14:29 2017
New Revision: 253943

URL: https://gcc.gnu.org/viewcvs?rev=253943&root=gcc&view=rev
Log:
PR libstdc++/79433 no #error for including headers with wrong -std

Backport from mainline
2017-09-12  Jonathan Wakely  <jwakely@redhat.com>

        PR libstdc++/79433
        * doc/xml/manual/status_cxx2017.xml: Update feature-test macros.
        * doc/html/*: Regenerate.
        * include/Makefile.am: Remove <bits/c++17_warning.h>.
        * include/Makefile.in: Regenerate.
        * include/bits/c++17_warning.h: Remove.
        * include/bits/string_view.tcc: Do not include <bits/c++17_warning.h>
        for pre-C++17 modes.
        * include/std/any: Likewise.
        (__cpp_lib_any): Define.
        * include/std/mutex (__cpp_lib_scoped_lock): Adjust value as per new
        SD-6 draft.
        * include/std/numeric (__cpp_lib_gcd_lcm): Define as per new SD-6
        draft.
        * include/std/optional: Do not include <bits/c++17_warning.h>.
        (__cpp_lib_optional): Define.
        * include/std/shared_mutex: Do not include <bits/c++14_warning.h>.
        * include/std/string_view: Do not include <bits/c++17_warning.h>.
        (__cpp_lib_string_view): Define.
        * include/std/variant: Do not include <bits/c++17_warning.h>.
        (__cpp_lib_variant): Define.
        * testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error line
        numbers.
        * testsuite/26_numerics/gcd/1.cc: Test for __cpp_lib_gcd_lcm.
        * testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line
        numbers.
        * testsuite/26_numerics/lcm/1.cc: Test for __cpp_lib_gcd_lcm.
        * testsuite/26_numerics/lcm/lcm_neg.cc: Adjust dg-error line
        numbers.
        * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Adjust
        expected value of __cpp_lib_scoped_lock.

Removed:
    branches/gcc-7-branch/libstdc++-v3/include/bits/c++17_warning.h
Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/doc/xml/manual/status_cxx2017.xml
    branches/gcc-7-branch/libstdc++-v3/include/Makefile.am
    branches/gcc-7-branch/libstdc++-v3/include/Makefile.in
    branches/gcc-7-branch/libstdc++-v3/include/bits/string_view.tcc
    branches/gcc-7-branch/libstdc++-v3/include/std/any
    branches/gcc-7-branch/libstdc++-v3/include/std/mutex
    branches/gcc-7-branch/libstdc++-v3/include/std/numeric
    branches/gcc-7-branch/libstdc++-v3/include/std/optional
    branches/gcc-7-branch/libstdc++-v3/include/std/shared_mutex
    branches/gcc-7-branch/libstdc++-v3/include/std/string_view
    branches/gcc-7-branch/libstdc++-v3/include/std/variant
   
branches/gcc-7-branch/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc
    branches/gcc-7-branch/libstdc++-v3/testsuite/26_numerics/gcd/1.cc
    branches/gcc-7-branch/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
    branches/gcc-7-branch/libstdc++-v3/testsuite/26_numerics/lcm/1.cc
    branches/gcc-7-branch/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc


More information about the Gcc-bugs mailing list