From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 977DE3853C1C; Thu, 12 Aug 2021 14:04:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 977DE3853C1C MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-2880] libstdc++: Add #error to some files that depend on a specific standard mode X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 432de08498142d2266c0fb05f2c555a7f1e10ddd X-Git-Newrev: d3a7fbcb7c7a1016ceac2ceaf79b28c17ce9fcd7 Message-Id: <20210812140403.977DE3853C1C@sourceware.org> Date: Thu, 12 Aug 2021 14:04:03 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2021 14:04:03 -0000 https://gcc.gnu.org/g:d3a7fbcb7c7a1016ceac2ceaf79b28c17ce9fcd7 commit r12-2880-gd3a7fbcb7c7a1016ceac2ceaf79b28c17ce9fcd7 Author: Jonathan Wakely Date: Thu Aug 12 13:33:43 2021 +0100 libstdc++: Add #error to some files that depend on a specific standard mode Give more explicit errors if these files are not built with the correct -std options. libstdc++-v3/ChangeLog: * src/c++98/locale_init.cc: Require C++11. * src/c++98/localename.cc: Likewise. * src/c++98/misc-inst.cc: Require C++98. Diff: --- libstdc++-v3/src/c++98/locale_init.cc | 4 ++++ libstdc++-v3/src/c++98/localename.cc | 4 ++++ libstdc++-v3/src/c++98/misc-inst.cc | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/libstdc++-v3/src/c++98/locale_init.cc b/libstdc++-v3/src/c++98/locale_init.cc index 4bec50bf595..e96b1a336aa 100644 --- a/libstdc++-v3/src/c++98/locale_init.cc +++ b/libstdc++-v3/src/c++98/locale_init.cc @@ -20,6 +20,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#if __cplusplus != 201103L +# error This file must be compiled as C++11 +#endif + #define _GLIBCXX_USE_CXX11_ABI 1 #include #include diff --git a/libstdc++-v3/src/c++98/localename.cc b/libstdc++-v3/src/c++98/localename.cc index 350dcf5ad0f..9c707b2327c 100644 --- a/libstdc++-v3/src/c++98/localename.cc +++ b/libstdc++-v3/src/c++98/localename.cc @@ -20,6 +20,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#if __cplusplus != 201103L +# error This file must be compiled as C++11 +#endif + #define _GLIBCXX_USE_CXX11_ABI 1 #include #include diff --git a/libstdc++-v3/src/c++98/misc-inst.cc b/libstdc++-v3/src/c++98/misc-inst.cc index 09851903600..85a4287e113 100644 --- a/libstdc++-v3/src/c++98/misc-inst.cc +++ b/libstdc++-v3/src/c++98/misc-inst.cc @@ -26,6 +26,10 @@ // ISO C++ 14882: // +#if __cplusplus != 199711L +# error This file must be compiled as C++98 +#endif + #define _GLIBCXX_USE_CXX11_ABI 1 #define _GLIBCXX_DISAMBIGUATE_REPLACE_INST 1 #include