From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31866 invoked by alias); 12 Jan 2019 13:08:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31662 invoked by uid 89); 12 Jan 2019 13:08:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=23119, Almost, P0515R3, p0515r3 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 12 Jan 2019 13:08:21 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4F3387628 for ; Sat, 12 Jan 2019 13:08:19 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31754101961E; Sat, 12 Jan 2019 13:08:19 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x0CD8GLP014360; Sat, 12 Jan 2019 14:08:17 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x0CD8FuU014359; Sat, 12 Jan 2019 14:08:15 +0100 Date: Sat, 12 Jan 2019 13:08:00 -0000 From: Jakub Jelinek To: Jason Merrill , Jonathan Wakely Cc: gcc-patches@gcc.gnu.org Subject: [wwwdocs] Add __cpp_* feature macros to C++20 entries + other changes that have those in projects/cxx_status.html Message-ID: <20190112130815.GT30353@tucnak> Reply-To: Jakub Jelinek References: <20190111155411.GP30353@tucnak> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ctP54qlpMx3WjD+/" Content-Disposition: inline In-Reply-To: <20190111155411.GP30353@tucnak> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00696.txt.bz2 --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 8751 Hi! On Fri, Jan 11, 2019 at 04:54:11PM +0100, Jakub Jelinek wrote: > I've noticed we don't have any feature test macros in the table for C++20, > even when a couple of the features have them defined. Here is an updated patch, that in addition to that makes 9 URLs as we now have #cxx in gcc-9/changes.html and adds missing P0941R2 entry that clang table has. For that one I'm not 100% sure what to say, I've copied all the macros from http://wg21.link/p0941r2 into two source files (attached below), one for core language features, another one for library and tested those with -std=c++2a with current trunk. Compared to what the paper lists, we have __has_cpp_attribute (carries_dependency) 0, __cpp_guaranteed_copy_elision and __cpp_nontype_template_parameter_auto not defined. Is that what we want? On the library side, __cpp_lib_any, __cpp_lib_execution, __cpp_lib_hardware_interference_size, __cpp_lib_null_iterators, __cpp_lib_parallel_algorithm, __cpp_lib_raw_memory_algorithms, __cpp_lib_to_chars, __cpp_lib_uncaught_exceptions, __cpp_lib_variant macros aren't defined (at least not in ) and __cpp_lib_optional, __cpp_lib_shared_ptr_arrays, __cpp_lib_string_view have smaller values than those in the P0941R2. Is that the desirable state given current C++2A implementation status? Ok for wwwdocs (or do you suggest something different for the P0941R2 imlementation status)? --- htdocs/projects/cxx-status.html.jj 2019-01-12 12:27:22.966732519 +0100 +++ htdocs/projects/cxx-status.html 2019-01-12 13:57:47.457900425 +0100 @@ -115,7 +115,7 @@ Range-based for statements with initializer P0614R1 - 9 + 9 @@ -127,28 +127,28 @@ ADL and function templates that are not visible P0846R0 - 9 + 9 const mismatch with defaulted copy constructor P0641R2 - 9 + 9 Less eager instantiation of constexpr functions P0859R0 - 5.2 (mostly)
9 (P0859R0) + 5.2 (mostly)
9 (P0859R0) Consistent comparison (operator<=>) P0515R3
- P0905R1
+ P0905R1
P1120R0 No - + __cpp_impl_three_way_comparison >= 201711 Access checking on specializations @@ -159,19 +159,19 @@ Default constructible and assignable stateless lambdas P0624R2 - 9 + 9 Lambdas in unevaluated contexts P0315R4 - 9 + 9 Language support for empty objects P0840R2 - 9 + 9 @@ -195,32 +195,32 @@ Down with typename! P0634R3 - 9 + 9 Allow pack expansion in lambda init-capture P0780R2 - 9 + 9 Proposed wording for likely and unlikely attributes P0479R5 - 9 + 9 Deprecate implicit capture of this via [=] P0806R2 - 9 + 9 Class Types in Non-Type Template Parameters P0732R2 - 9 - + 9 + __cpp_nontype_template_parameter_class >= 201806 Atomic Compare-and-Exchange with Padding Bits @@ -231,19 +231,19 @@ Efficient sized delete for variable sized classes P0722R3 - 9 - + 9 + __cpp_impl_destroying_delete >= 201806 Allowing Virtual Function Calls in Constant Expressions P1064R0 - 9 + 9 Prohibit aggregates with user-declared constructors P1008R1 - 9 + 9 @@ -256,20 +256,20 @@ explicit(bool) P0892R2 - 9 - + 9 + __cpp_conditional_explicit >= 201806 Signed integers are two's complement P1236R1 - 9 + 9 char8_t P0482R6 No - + __cpp_char8_t >= 201811 Immediate functions (consteval) @@ -280,23 +280,29 @@ std::is_constant_evaluated P0595R2 - 9 + 9 Nested inline namespaces P1094R2 - 9 + 9 - Relaxations of constexpr restrictions + Relaxations of constexpr restrictions P1002R1
P1327R1
P1330R0 No + + Feature test macros + P0941R2
+ Almost all macros defined + +

C++17 Support in GCC

Jakub --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="p0941r2-1.C" Content-length: 1999 bool foo[] = { //__has_cpp_attribute (carries_dependency) >= 200809L, // is 0 __has_cpp_attribute (deprecated) >= 201309L, __has_cpp_attribute (fallthrough) >= 201603L, __has_cpp_attribute (likely) >= 201803L, __has_cpp_attribute (maybe_unused) >= 201603L, __has_cpp_attribute (no_unique_address) >= 201803L, __has_cpp_attribute (nodiscard) >= 201603L, __has_cpp_attribute (noreturn) >= 200809L, __has_cpp_attribute (unlikely) >= 201803L , __cpp_aggregate_bases >= 201603L, __cpp_aggregate_nsdmi >= 201304L, __cpp_alias_templates >= 200704L, __cpp_aligned_new >= 201606L, __cpp_attributes >= 200809L, __cpp_binary_literals >= 201304L, __cpp_capture_star_this >= 201603L, __cpp_constexpr >= 201603L, __cpp_decltype >= 200707L, __cpp_decltype_auto >= 201304L, __cpp_deduction_guides >= 201703L, __cpp_delegating_constructors >= 200604L, __cpp_enumerator_attributes >= 201411L, __cpp_fold_expressions >= 201603L, __cpp_generic_lambdas >= 201304L, // __cpp_guaranteed_copy_elision >= 201606L, __cpp_hex_float >= 201603L, __cpp_if_constexpr >= 201606L, __cpp_inheriting_constructors >= 201511L, __cpp_init_captures >= 201304L, __cpp_initializer_lists >= 200806L, __cpp_inline_variables >= 201606L, __cpp_lambdas >= 200907L, __cpp_namespace_attributes >= 201411L, __cpp_noexcept_function_type >= 201510L, __cpp_nontype_template_args >= 201411L, // __cpp_nontype_template_parameter_auto >= 201606L, __cpp_nsdmi >= 200809L, __cpp_range_based_for >= 201603L, __cpp_raw_strings >= 200710L, __cpp_ref_qualifiers >= 200710L, __cpp_return_type_deduction >= 201304L, __cpp_rvalue_references >= 200610L, __cpp_sized_deallocation >= 201309L, __cpp_static_assert >= 201411L, __cpp_structured_bindings >= 201606L, __cpp_template_template_args >= 201611L, __cpp_threadsafe_static_init >= 200806L, __cpp_unicode_characters >= 200704L, __cpp_unicode_literals >= 200710L, __cpp_user_defined_literals >= 200809L, __cpp_variable_templates >= 201304L, __cpp_variadic_templates >= 200704L, __cpp_variadic_using >= 201611L }; --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="p0941r2-2.C" Content-length: 2678 #include bool bar[] = { __cpp_lib_addressof_constexpr >= 201603L, __cpp_lib_allocator_traits_is_always_equal >= 201411L, // __cpp_lib_any >= 201606L, __cpp_lib_apply >= 201603L, __cpp_lib_array_constexpr >= 201603L, __cpp_lib_as_const >= 201510L, __cpp_lib_atomic_is_always_lock_free >= 201603L, __cpp_lib_bool_constant >= 201505L, __cpp_lib_boyer_moore_searcher >= 201603L, __cpp_lib_byte >= 201603L, __cpp_lib_chrono >= 201611L, __cpp_lib_clamp >= 201603L, __cpp_lib_complex_udls >= 201309L, __cpp_lib_enable_shared_from_this >= 201603L, __cpp_lib_exchange_function >= 201304L, // __cpp_lib_execution >= 201603L, __cpp_lib_filesystem >= 201703L, __cpp_lib_gcd_lcm >= 201606L, __cpp_lib_generic_associative_lookup >= 201304L, // __cpp_lib_hardware_interference_size >= 201703L, __cpp_lib_has_unique_object_representations >= 201606L, __cpp_lib_hypot >= 201603L, __cpp_lib_incomplete_container_elements >= 201505L, __cpp_lib_integer_sequence >= 201304L, __cpp_lib_integral_constant_callable >= 201304L, __cpp_lib_invoke >= 201411L, __cpp_lib_is_aggregate >= 201703L, __cpp_lib_is_final >= 201402L, __cpp_lib_is_invocable >= 201703L, __cpp_lib_is_null_pointer >= 201309L, __cpp_lib_is_swappable >= 201603L, __cpp_lib_launder >= 201606L, __cpp_lib_logical_traits >= 201510L, __cpp_lib_make_from_tuple >= 201606L, __cpp_lib_make_reverse_iterator >= 201402L, __cpp_lib_make_unique >= 201304L, __cpp_lib_map_try_emplace >= 201411L, __cpp_lib_math_special_functions >= 201603L, __cpp_lib_memory_resource >= 201603L, __cpp_lib_node_extract >= 201606L, __cpp_lib_nonmember_container_access >= 201411L, __cpp_lib_not_fn >= 201603L, // __cpp_lib_null_iterators >= 201304L, // __cpp_lib_optional >= 201606L, // is 201603L // __cpp_lib_parallel_algorithm >= 201603L, __cpp_lib_quoted_string_io >= 201304L, // __cpp_lib_raw_memory_algorithms >= 201606L, __cpp_lib_result_of_sfinae >= 201210L, __cpp_lib_robust_nonmodifying_seq_ops >= 201304L, __cpp_lib_sample >= 201603L, __cpp_lib_scoped_lock >= 201703L, __cpp_lib_shared_mutex >= 201505L, // __cpp_lib_shared_ptr_arrays >= 201611L, // is 201603L __cpp_lib_shared_ptr_weak_type >= 201606L, __cpp_lib_shared_timed_mutex >= 201402L, __cpp_lib_string_udls >= 201304L, // __cpp_lib_string_view >= 201606L, // is 201603L // __cpp_lib_to_chars >= 201611L, __cpp_lib_transformation_trait_aliases >= 201304L, __cpp_lib_transparent_operators >= 201510L, __cpp_lib_tuple_element_t >= 201402L, __cpp_lib_tuples_by_type >= 201304L, __cpp_lib_type_trait_variable_templates >= 201510L, // __cpp_lib_uncaught_exceptions >= 201411L, __cpp_lib_unordered_map_try_emplace >= 201411L, // __cpp_lib_variant >= 201606L, __cpp_lib_void_t >= 201411L }; --ctP54qlpMx3WjD+/--