public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR libstdc++/81064 fix versioned namespace
@ 2017-07-17 20:55 François Dumont
  2017-07-18 13:31 ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: François Dumont @ 2017-07-17 20:55 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 7144 bytes --]

Hi

     Here is the patch to fix libstdc++ versioned namespace.

     Now versioned namespace is only at std and __gnu_cxx levels, not 
anymore in nested namespaces.

    PR libstdc++/81064

     * include/bits/algorithmfwd.h: Reorganize versioned namespace.
     * include/bits/basic_string.h: Likewise.
     * include/bits/c++config: Likewise.
     * include/bits/deque.tcc: Likewise.
     * include/bits/forward_list.h: Likewise.
     * include/bits/forward_list.tcc: Likewise.
     * include/bits/hashtable_policy.h: Likewise.
     * include/bits/list.tcc: Likewise.
     * include/bits/move.h: Likewise.
     * include/bits/quoted_string.h: Likewise.
     * include/bits/random.h: Likewise.
     * include/bits/random.tcc: Likewise.
     * include/bits/regex.h: Likewise.
     * include/bits/regex.tcc: Likewise.
     * include/bits/regex_automaton.h: Likewise.
     * include/bits/regex_automaton.tcc: Likewise.
     * include/bits/regex_compiler.h: Likewise.
     * include/bits/regex_compiler.tcc: Likewise.
     * include/bits/regex_constants.h: Likewise.
     * include/bits/regex_error.h: Likewise.
     * include/bits/regex_executor.h: Likewise.
     * include/bits/regex_executor.tcc: Likewise.
     * include/bits/regex_scanner.h: Likewise.
     * include/bits/regex_scanner.tcc: Likewise.
     * include/bits/specfun.h: Likewise.
     * include/bits/stl_algo.h: Likewise.
     * include/bits/stl_algobase.h: Likewise.
     * include/bits/stl_bvector.h: Likewise.
     * include/bits/stl_deque.h: Likewise.
     * include/bits/stl_iterator.h: Likewise.
     * include/bits/stl_iterator_base_funcs.h: Likewise.
     * include/bits/stl_list.h: Likewise.
     * include/bits/stl_map.h: Likewise.
     * include/bits/stl_multimap.h: Likewise.
     * include/bits/stl_multiset.h: Likewise.
     * include/bits/stl_relops.h: Likewise.
     * include/bits/stl_set.h: Likewise.
     * include/bits/stl_vector.h: Likewise.
     * include/bits/uniform_int_dist.h: Likewise.
     * include/bits/unordered_map.h: Likewise.
     * include/bits/unordered_set.h: Likewise.
     * include/bits/vector.tcc: Likewise.
     * include/c_global/cmath: Likewise.
     * include/c_std/cmath: Likewise.
     * include/decimal/decimal: Likewise.
     * include/decimal/decimal.h: Likewise.
     * include/experimental/algorithm: Likewise.
     * include/experimental/any: Likewise.
     * include/experimental/array: Likewise.
     * include/experimental/bits/erase_if.h: Likewise.
     * include/experimental/bits/fs_dir.h: Likewise.
     * include/experimental/bits/fs_fwd.h: Likewise.
     * include/experimental/bits/fs_ops.h: Likewise.
     * include/experimental/bits/fs_path.h: Likewise.
     * include/experimental/bits/shared_ptr.h: Likewise.
     * include/experimental/bits/string_view.tcc: Likewise.
     * include/experimental/chrono: Likewise.
     * include/experimental/deque: Likewise.
     * include/experimental/filesystem: Likewise.
     * include/experimental/forward_list: Likewise.
     * include/experimental/functional: Likewise.
     * include/experimental/iterator: Likewise.
     * include/experimental/list: Likewise.
     * include/experimental/map: Likewise.
     * include/experimental/memory: Likewise.
     * include/experimental/memory_resource: Likewise.
     * include/experimental/numeric: Likewise.
     * include/experimental/optional: Likewise.
     * include/experimental/propagate_const: Likewise.
     * include/experimental/random: Likewise.
     * include/experimental/ratio: Likewise.
     * include/experimental/regex: Likewise.
     * include/experimental/set: Likewise.
     * include/experimental/source_location: Likewise.
     * include/experimental/string: Likewise.
     * include/experimental/string_view: Likewise.
     * include/experimental/system_error: Likewise.
     * include/experimental/tuple: Likewise.
     * include/experimental/type_traits: Likewise.
     * include/experimental/unordered_map: Likewise.
     * include/experimental/unordered_set: Likewise.
     * include/experimental/utility: Likewise.
     * include/experimental/vector: Likewise.
     * include/ext/bitmap_allocator.h: Likewise.
     * include/ext/codecvt_specializations.h: Likewise.
     * include/ext/rope: Likewise.
     * include/ext/typelist.h: Likewise.
     * include/std/chrono: Likewise.
     * include/std/complex: Likewise.
     * include/std/functional: Likewise.
     * include/std/numeric: Likewise.
     * include/std/string_view: Likewise.
     * include/std/thread: Likewise.
     * include/std/variant: Likewise.
     * include/tr1/array: Likewise.
     * include/tr1/bessel_function.tcc: Likewise.
     * include/tr1/beta_function.tcc: Likewise.
     * include/tr1/cmath: Likewise.
     * include/tr1/complex: Likewise.
     * include/tr1/ell_integral.tcc: Likewise.
     * include/tr1/exp_integral.tcc: Likewise.
     * include/tr1/functional: Likewise.
     * include/tr1/functional_hash.h: Likewise.
     * include/tr1/gamma.tcc: Likewise.
     * include/tr1/hashtable.h: Likewise.
     * include/tr1/hashtable_policy.h: Likewise.
     * include/tr1/hypergeometric.tcc: Likewise.
     * include/tr1/legendre_function.tcc: Likewise.
     * include/tr1/modified_bessel_func.tcc: Likewise.
     * include/tr1/poly_hermite.tcc: Likewise.
     * include/tr1/poly_laguerre.tcc: Likewise.
     * include/tr1/random.h: Likewise.
     * include/tr1/random.tcc: Likewise.
     * include/tr1/regex: Likewise.
     * include/tr1/riemann_zeta.tcc: Likewise.
     * include/tr1/shared_ptr.h: Likewise.
     * include/tr1/special_function_util.h: Likewise.
     * include/tr1/tuple: Likewise.
     * include/tr1/type_traits: Likewise.
     * include/tr1/unordered_map.h: Likewise.
     * include/tr1/unordered_set.h: Likewise.
     * include/tr1/utility: Likewise.
     * include/tr2/bool_set: Likewise.
     * include/tr2/bool_set.tcc: Likewise.
     * include/tr2/dynamic_bitset: Likewise.
     * include/tr2/dynamic_bitset.tcc: Likewise.
     * include/tr2/ratio: Likewise.
     * include/tr2/type_traits: Likewise.
     * src/c++11/chrono.cc: Likewise.
     * src/c++11/compatibility-c++0x.cc: Likewise.
     * src/c++11/compatibility-chrono.cc: Likewise.
     * src/c++11/cxx11-shim_facets.cc: Likewise.
     * src/c++11/hashtable_c++0x.cc: Likewise.
     * src/c++11/placeholders.cc: Likewise.
     * src/c++11/thread.cc: Likewise.
     * src/c++98/bitmap_allocator.cc: Likewise.
     * src/c++98/hashtable_tr1.cc: Likewise.
     * src/c++98/list.cc: Likewise.
     * src/shared/hashtable-aux.cc: Likewise.
     * python/libstdcxx/v6/printers.py: Adapt.
     * testsuite/20_util/duration/literals/range.cc: Adapt line number.
     * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
     * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
     * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
     * testsuite/20_util/forward/c_neg.cc: Likewise.
     * testsuite/20_util/forward/f_neg.cc: Likewise.
     * testsuite/26_numerics/random/pr60037-neg.cc: Likewise.

Tested under normal and versioned namespace modes.

Ok to commit ?

François


[-- Attachment #2: versioned_namespace.patch.bz2 --]
[-- Type: application/x-bzip, Size: 19595 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR libstdc++/81064 fix versioned namespace
  2017-07-17 20:55 [PATCH] PR libstdc++/81064 fix versioned namespace François Dumont
@ 2017-07-18 13:31 ` Jonathan Wakely
  2017-07-18 13:31   ` Jonathan Wakely
  2017-07-18 14:03   ` Ville Voutilainen
  0 siblings, 2 replies; 6+ messages in thread
From: Jonathan Wakely @ 2017-07-18 13:31 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++, gcc-patches

On 17/07/17 22:54 +0200, François Dumont wrote:
>Hi
>
>    Here is the patch to fix libstdc++ versioned namespace.
>
>    Now versioned namespace is only at std and __gnu_cxx levels, not 
>anymore in nested namespaces.
>
>   PR libstdc++/81064
>
>    * include/bits/algorithmfwd.h: Reorganize versioned namespace.
>    * include/bits/basic_string.h: Likewise.
>    * include/bits/c++config: Likewise.
>    * include/bits/deque.tcc: Likewise.
>    * include/bits/forward_list.h: Likewise.
>    * include/bits/forward_list.tcc: Likewise.
>    * include/bits/hashtable_policy.h: Likewise.
>    * include/bits/list.tcc: Likewise.
>    * include/bits/move.h: Likewise.
>    * include/bits/quoted_string.h: Likewise.
>    * include/bits/random.h: Likewise.
>    * include/bits/random.tcc: Likewise.
>    * include/bits/regex.h: Likewise.
>    * include/bits/regex.tcc: Likewise.
>    * include/bits/regex_automaton.h: Likewise.
>    * include/bits/regex_automaton.tcc: Likewise.
>    * include/bits/regex_compiler.h: Likewise.
>    * include/bits/regex_compiler.tcc: Likewise.
>    * include/bits/regex_constants.h: Likewise.
>    * include/bits/regex_error.h: Likewise.
>    * include/bits/regex_executor.h: Likewise.
>    * include/bits/regex_executor.tcc: Likewise.
>    * include/bits/regex_scanner.h: Likewise.
>    * include/bits/regex_scanner.tcc: Likewise.
>    * include/bits/specfun.h: Likewise.
>    * include/bits/stl_algo.h: Likewise.
>    * include/bits/stl_algobase.h: Likewise.
>    * include/bits/stl_bvector.h: Likewise.
>    * include/bits/stl_deque.h: Likewise.
>    * include/bits/stl_iterator.h: Likewise.
>    * include/bits/stl_iterator_base_funcs.h: Likewise.
>    * include/bits/stl_list.h: Likewise.
>    * include/bits/stl_map.h: Likewise.
>    * include/bits/stl_multimap.h: Likewise.
>    * include/bits/stl_multiset.h: Likewise.
>    * include/bits/stl_relops.h: Likewise.
>    * include/bits/stl_set.h: Likewise.
>    * include/bits/stl_vector.h: Likewise.
>    * include/bits/uniform_int_dist.h: Likewise.
>    * include/bits/unordered_map.h: Likewise.
>    * include/bits/unordered_set.h: Likewise.
>    * include/bits/vector.tcc: Likewise.
>    * include/c_global/cmath: Likewise.
>    * include/c_std/cmath: Likewise.
>    * include/decimal/decimal: Likewise.
>    * include/decimal/decimal.h: Likewise.
>    * include/experimental/algorithm: Likewise.
>    * include/experimental/any: Likewise.
>    * include/experimental/array: Likewise.
>    * include/experimental/bits/erase_if.h: Likewise.
>    * include/experimental/bits/fs_dir.h: Likewise.
>    * include/experimental/bits/fs_fwd.h: Likewise.
>    * include/experimental/bits/fs_ops.h: Likewise.
>    * include/experimental/bits/fs_path.h: Likewise.
>    * include/experimental/bits/shared_ptr.h: Likewise.
>    * include/experimental/bits/string_view.tcc: Likewise.
>    * include/experimental/chrono: Likewise.
>    * include/experimental/deque: Likewise.
>    * include/experimental/filesystem: Likewise.
>    * include/experimental/forward_list: Likewise.
>    * include/experimental/functional: Likewise.
>    * include/experimental/iterator: Likewise.
>    * include/experimental/list: Likewise.
>    * include/experimental/map: Likewise.
>    * include/experimental/memory: Likewise.
>    * include/experimental/memory_resource: Likewise.
>    * include/experimental/numeric: Likewise.
>    * include/experimental/optional: Likewise.
>    * include/experimental/propagate_const: Likewise.
>    * include/experimental/random: Likewise.
>    * include/experimental/ratio: Likewise.
>    * include/experimental/regex: Likewise.
>    * include/experimental/set: Likewise.
>    * include/experimental/source_location: Likewise.
>    * include/experimental/string: Likewise.
>    * include/experimental/string_view: Likewise.
>    * include/experimental/system_error: Likewise.
>    * include/experimental/tuple: Likewise.
>    * include/experimental/type_traits: Likewise.
>    * include/experimental/unordered_map: Likewise.
>    * include/experimental/unordered_set: Likewise.
>    * include/experimental/utility: Likewise.
>    * include/experimental/vector: Likewise.
>    * include/ext/bitmap_allocator.h: Likewise.
>    * include/ext/codecvt_specializations.h: Likewise.
>    * include/ext/rope: Likewise.
>    * include/ext/typelist.h: Likewise.
>    * include/std/chrono: Likewise.
>    * include/std/complex: Likewise.
>    * include/std/functional: Likewise.
>    * include/std/numeric: Likewise.
>    * include/std/string_view: Likewise.
>    * include/std/thread: Likewise.
>    * include/std/variant: Likewise.
>    * include/tr1/array: Likewise.
>    * include/tr1/bessel_function.tcc: Likewise.
>    * include/tr1/beta_function.tcc: Likewise.
>    * include/tr1/cmath: Likewise.
>    * include/tr1/complex: Likewise.
>    * include/tr1/ell_integral.tcc: Likewise.
>    * include/tr1/exp_integral.tcc: Likewise.
>    * include/tr1/functional: Likewise.
>    * include/tr1/functional_hash.h: Likewise.
>    * include/tr1/gamma.tcc: Likewise.
>    * include/tr1/hashtable.h: Likewise.
>    * include/tr1/hashtable_policy.h: Likewise.
>    * include/tr1/hypergeometric.tcc: Likewise.
>    * include/tr1/legendre_function.tcc: Likewise.
>    * include/tr1/modified_bessel_func.tcc: Likewise.
>    * include/tr1/poly_hermite.tcc: Likewise.
>    * include/tr1/poly_laguerre.tcc: Likewise.
>    * include/tr1/random.h: Likewise.
>    * include/tr1/random.tcc: Likewise.
>    * include/tr1/regex: Likewise.
>    * include/tr1/riemann_zeta.tcc: Likewise.
>    * include/tr1/shared_ptr.h: Likewise.
>    * include/tr1/special_function_util.h: Likewise.
>    * include/tr1/tuple: Likewise.
>    * include/tr1/type_traits: Likewise.
>    * include/tr1/unordered_map.h: Likewise.
>    * include/tr1/unordered_set.h: Likewise.
>    * include/tr1/utility: Likewise.
>    * include/tr2/bool_set: Likewise.
>    * include/tr2/bool_set.tcc: Likewise.
>    * include/tr2/dynamic_bitset: Likewise.
>    * include/tr2/dynamic_bitset.tcc: Likewise.
>    * include/tr2/ratio: Likewise.
>    * include/tr2/type_traits: Likewise.
>    * src/c++11/chrono.cc: Likewise.
>    * src/c++11/compatibility-c++0x.cc: Likewise.
>    * src/c++11/compatibility-chrono.cc: Likewise.
>    * src/c++11/cxx11-shim_facets.cc: Likewise.
>    * src/c++11/hashtable_c++0x.cc: Likewise.
>    * src/c++11/placeholders.cc: Likewise.
>    * src/c++11/thread.cc: Likewise.
>    * src/c++98/bitmap_allocator.cc: Likewise.
>    * src/c++98/hashtable_tr1.cc: Likewise.
>    * src/c++98/list.cc: Likewise.
>    * src/shared/hashtable-aux.cc: Likewise.
>    * python/libstdcxx/v6/printers.py: Adapt.
>    * testsuite/20_util/duration/literals/range.cc: Adapt line number.
>    * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
>    * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
>    * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
>    * testsuite/20_util/forward/c_neg.cc: Likewise.
>    * testsuite/20_util/forward/f_neg.cc: Likewise.
>    * testsuite/26_numerics/random/pr60037-neg.cc: Likewise.
>
>Tested under normal and versioned namespace modes.
>
>Ok to commit ?

This is quite a huge change, so I'd like to wait and see if anyone
else has any opinion on it.

Personally I think it's necessary (assuming I understand the PR
correctly) and so if nobody objects I think we should go with this
change for GCC 8. Let's give it a few days for comments (and I'll
finish going through the patch carefully).




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR libstdc++/81064 fix versioned namespace
  2017-07-18 13:31 ` Jonathan Wakely
@ 2017-07-18 13:31   ` Jonathan Wakely
  2017-07-18 14:03   ` Ville Voutilainen
  1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2017-07-18 13:31 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++, gcc-patches

On 18/07/17 14:31 +0100, Jonathan Wakely wrote:
>On 17/07/17 22:54 +0200, François Dumont wrote:
>This is quite a huge change, so I'd like to wait and see if anyone
>else has any opinion on it.
>
>Personally I think it's necessary (assuming I understand the PR
>correctly) and so if nobody objects I think we should go with this
>change for GCC 8. Let's give it a few days for comments (and I'll
>finish going through the patch carefully).

P.S. thanks very much for doing it!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR libstdc++/81064 fix versioned namespace
  2017-07-18 13:31 ` Jonathan Wakely
  2017-07-18 13:31   ` Jonathan Wakely
@ 2017-07-18 14:03   ` Ville Voutilainen
  2017-07-18 19:17     ` François Dumont
  2017-07-19 21:02     ` François Dumont
  1 sibling, 2 replies; 6+ messages in thread
From: Ville Voutilainen @ 2017-07-18 14:03 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: François Dumont, libstdc++, gcc-patches

On 18 July 2017 at 16:31, Jonathan Wakely <jwakely@redhat.com> wrote:
> This is quite a huge change, so I'd like to wait and see if anyone
> else has any opinion on it.
>
> Personally I think it's necessary (assuming I understand the PR
> correctly) and so if nobody objects I think we should go with this
> change for GCC 8. Let's give it a few days for comments (and I'll
> finish going through the patch carefully).


Looks like the right approach to me. I haven't looked at the patch in
detail, but the main gist
of it is something that we should certainly do for GCC 8. The Elf says "aye".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR libstdc++/81064 fix versioned namespace
  2017-07-18 14:03   ` Ville Voutilainen
@ 2017-07-18 19:17     ` François Dumont
  2017-07-19 21:02     ` François Dumont
  1 sibling, 0 replies; 6+ messages in thread
From: François Dumont @ 2017-07-18 19:17 UTC (permalink / raw)
  To: Ville Voutilainen, Jonathan Wakely; +Cc: libstdc++, gcc-patches

On 18/07/2017 16:03, Ville Voutilainen wrote:
> On 18 July 2017 at 16:31, Jonathan Wakely <jwakely@redhat.com> wrote:
>> This is quite a huge change, so I'd like to wait and see if anyone
>> else has any opinion on it.
>>
>> Personally I think it's necessary (assuming I understand the PR
>> correctly) and so if nobody objects I think we should go with this
>> change for GCC 8. Let's give it a few days for comments (and I'll
>> finish going through the patch carefully).
>
> Looks like the right approach to me. I haven't looked at the patch in
> detail, but the main gist
> of it is something that we should certainly do for GCC 8. The Elf says "aye".
>
Thanks for the feedbacks.

However I've been a little bit too confident regarding its validation. 
There are unexpected failures when versioned namespace is activated.

Most of them are related to its usage with experimental namespace. I 
haven't yet fully consider it but just in case: do we really need to 
have versioned namespace on top of experimental namespace ?

François


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR libstdc++/81064 fix versioned namespace
  2017-07-18 14:03   ` Ville Voutilainen
  2017-07-18 19:17     ` François Dumont
@ 2017-07-19 21:02     ` François Dumont
  1 sibling, 0 replies; 6+ messages in thread
From: François Dumont @ 2017-07-19 21:02 UTC (permalink / raw)
  To: Ville Voutilainen, Jonathan Wakely; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]

Here is the revisited version passing all tests successfully except 2 
that are also failing without the patch:
FAIL: 21_strings/basic_string/modifiers/insert/char/1.cc execution test
FAIL: 21_strings/basic_string/modifiers/insert/wchar_t/1.cc execution test

This is a rather mechanical change except for few files I would like to 
comment on:
- include/bits/c++config
     I removed many declaration of namespace that are not necessary as 
we don't need to declare any nested inline namespace anymore. In this 
last version I managed to isolate the versioned namespace value to a 
single location: the definition of _GLIBCXX_BEGIN_VERSION_NAMESPACE. 
After the patch it is the only location of this version information so 
next bump will be resume to updating c++config apart from python and 
build scripts.

     Note that the PR seems to say that the namespace should be always 
declared the same way. In this patch __8 is declared inline only in 
c++config, _GLIBCXX_BEGIN_VERSION_NAMESPACE don't repeat the inline keyword.

- include/bits/regex.h
- include/std/variant

     In those 2 files we were having:
        friend bool __detail::
#if _GLIBCXX_INLINE_VERSION
         __8:: // Required due to PR c++/59256
#endif
     ...

     I don't know if the front end change was to fix c++/59256 or if it 
is due to the new namespace organization but I removed this code and 
tests are successful. They were of course failing because there is no 
more __detail::__8.

     I am now ready to commit. I'll do it this week-end if I have no 
further feedback.

François



[-- Attachment #2: versioned_namespace.patch.bz2 --]
[-- Type: application/x-bzip, Size: 19802 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-19 21:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 20:55 [PATCH] PR libstdc++/81064 fix versioned namespace François Dumont
2017-07-18 13:31 ` Jonathan Wakely
2017-07-18 13:31   ` Jonathan Wakely
2017-07-18 14:03   ` Ville Voutilainen
2017-07-18 19:17     ` François Dumont
2017-07-19 21:02     ` François Dumont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).