This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix libstdc++ versioned namespace build


On 03/10/16 15:41 +0100, Jonathan Wakely wrote:
The versioned namespace build has been broken on all branches for some
time. It's due to new code that doesn't use the namespace macros in
the right places. This fixes all issues.

Rather than declaring the std::experimental::* namespaces in
<bits/c++config.h> I've added a new file that declares them and is
only included by LFTS headers. That allows the new test to pass, which
verifies that the std::experimental namespace doesn't exist when no TS
headers are included.

	PR libstdc++/68323
	PR libstdc++/77794
	* config/abi/pre/gnu-versioned-namespace.ver: Add exports for
	__cxa_thread_atexit and __gnu_cxx::__freeres.
	* include/Makefile.am: Add <experimental/bits/lfts_config.h>
	* include/Makefile.in: Regenerate.
	* include.bits/basic_string.h: Fix nesting of versioned namespaces.
	* include/bits/c++config: Declare versioned namespaces for literals.
	* include/bits/regex.h (basic_regex, match_results): Add workarounds
	for PR c++/59256.
	* include/bits/uniform_int_dist.h: Fix nesting of versioned namespace.
	* include/std/chrono: Likewise.
	* include/std/complex: Likewise.
	* include/std/string_view: Likewise.
	* include/std/variant: Likewise. Add workaround for PR c++/59256.
	* include/experimental/bits/fs_fwd.h: Declare versioned namespace.
	* include/experimental/bits/lfts_config.h: Declare versioned
	namespaces.
	* include/experimental/algorithm: Include
	<experimental/bits/lfts_config.h>.
	* include/experimental/any: Likewise.
	* include/experimental/bits/erase_if.h: Likewise.
	* include/experimental/chrono: Likewise.
	* include/experimental/functional: Likewise.
	* include/experimental/memory_resource: Likewise.
	* include/experimental/optional: Likewise.
	* include/experimental/propagate_const: Likewise.
	* include/experimental/random: Likewise.
	* include/experimental/ratio: Likewise.
	* include/experimental/system_error: Likewise.
	* include/experimental/tuple: Likewise.
	* include/experimental/type_traits: Likewise.
	* include/experimental/utility: Likewise.
	* include/experimental/string_view: Likewise. Fix nesting of
	versioned namespaces.
	* include/experimental/bits/string_view.tcc: Reopen inline namespace
	for non-inline function definitions.
	* testsuite/17_intro/using_namespace_std_exp_neg.cc: New test.
	* testsuite/20_util/duration/literals/range.cc: Adjust dg-error line.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Likewise.
	* testsuite/experimental/propagate_const/assignment/move_neg.cc:
	Likewise.
	* testsuite/experimental/propagate_const/cons/move_neg.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements2.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements3.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements4.cc: Likewise.
	* testsuite/experimental/propagate_const/requirements5.cc: Likewise.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Likewise.

Tested x86_64-linux, with --enable-symvers=gnu-versioned-namespace and
--enable-symvers=gnu, on trunk and gcc-6 and gcc-5 branches.

The only failures are in synopsis.cc tests which expect to be able to
redeclare names in namespace std (which is ambiguous if they're really
declared in std::__7) or in tests that use scan-assembler or GDB and
the expected strings are different due to the __7 namespace. I will
probably add an effective target for the versioned namespace so we can
disable those tests when they're going to fail.

Committed to trunk and gcc-6 and gcc-5 branches.

It appears that I failed to squash my work-in-progress commits on the
gcc-6-branch, sorry.

The following commits (r240715-r240718) should have been the same
commit as r240719, and won't build for the default config (they work
for --enable-symvers=gnu-versioned-namespace, but commit r240719 has a
fix to make it also build for --enable-symvers=gnu, which is why it
all needed to be squashed into a single commit.

Apologies for messing up the branch.


commit b78f70a1eeac5da59f977fa58c332490e05c14b5
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Oct 3 14:36:18 2016 +0000

   add exports
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@240718 138bc75d-0d04-0410-961f-82ee72b054a4

commit e5e83353c99c7cabf8d7cdcdf7ee750e5ec7f129
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Oct 3 14:36:13 2016 +0000

   Fix misuse of versioned namespace for LFTS
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@240717 138bc75d-0d04-0410-961f-82ee72b054a4

commit a2121229a7e8405c7722a8b872d6ad8981c4b2d4
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Oct 3 14:36:06 2016 +0000

   Declare inline namespaces for filesystem
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@240716 138bc75d-0d04-0410-961f-82ee72b054a4

commit 0215eefdfd5d872a7056b50d23cd09a6bb14db0b
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Oct 3 14:35:59 2016 +0000

   fix misplaced version namespace macros
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@240715 138bc75d-0d04-0410-961f-82ee72b054a4



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]