From: Jonathan Wakely Date: Tue, 18 Aug 2015 18:04:32 +0000 (+0100) Subject: re PR libstdc++/67066 (libstdc++-v3/src/filesystem/dir.cc fails to compile with ... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c2b10d6a487ab040398152bf5326741432ae762;p=gcc.git re PR libstdc++/67066 (libstdc++-v3/src/filesystem/dir.cc fails to compile with --enable-concept-checks) PR libstdc++/67066 * doc/xml/manual/configure.xml (manual.intro.setup.configure): Add caveats for --enable-concept-checks. Improve link text. * doc/xml/manual/diagnostics.xml (std.diagnostics.concept_checking): Clarify caveats. * doc/html/*: Regenerate. * include/bits/stl_deque.h (deque): Only use concept checks in C++03. * include/bits/stl_stack.h (stack): Likewise. * include/bits/stl_vector.h (vector): Likewise. From-SVN: r226984 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0753951ef72..fed9a28cb37 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2015-08-18 Jonathan Wakely + + PR libstdc++/67066 + * doc/xml/manual/configure.xml (manual.intro.setup.configure): Add + caveats for --enable-concept-checks. Improve link text. + * doc/xml/manual/diagnostics.xml (std.diagnostics.concept_checking): + Clarify caveats. + * doc/html/*: Regenerate. + * include/bits/stl_deque.h (deque): Only use concept checks in C++03. + * include/bits/stl_stack.h (stack): Likewise. + * include/bits/stl_vector.h (vector): Likewise. + 2015-08-14 Jonathan Wakely * include/experimental/any (any::operator=(const any&)): Move check diff --git a/libstdc++-v3/doc/html/manual/concept_checking.html b/libstdc++-v3/doc/html/manual/concept_checking.html index 883eb5a7721..df7f22f7fcd 100644 --- a/libstdc++-v3/doc/html/manual/concept_checking.html +++ b/libstdc++-v3/doc/html/manual/concept_checking.html @@ -35,8 +35,9 @@ -D_GLIBCXX_CONCEPT_CHECKS.

Please note that the checks are based on the requirements in the original - C++ standard, some of which have changed in the new C++11 revision. - Additionally, some correct code might be rejected by the concept checks, + C++ standard, many of which were relaxed in the C++11 standard and so valid + C++11 code may be incorrectly rejected by the concept checks. Additionally, + some correct C++03 code might be rejected by the concept checks, for example template argument types may need to be complete when used in a template definition, rather than at the point of instantiation. There are no plans to address these shortcomings. diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html index 251c70e9da3..565d75e3e25 100644 --- a/libstdc++-v3/doc/html/manual/configure.html +++ b/libstdc++-v3/doc/html/manual/configure.html @@ -169,10 +169,12 @@ Mostly useful together with shared memory allocators, see PR libstdc++/16612 for details.

--enable-concept-checks

This turns on additional compile-time checks for instantiated - library templates, in the form of specialized templates, - described here. They + library templates, in the form of specialized templates described in + the Concept + Checking section. They can help users discover when they break the rules of the STL, before - their programs run. + their programs run. These checks are based on C++03 rules and some of + them are not compatible with correct C++11 code.

--enable-symvers[=style]

In 3.1 and later, tries to turn on symbol versioning in the shared library (if a shared library has been requested). Values for 'style' that are currently supported diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html index 4ec871f1127..9052ce64a0c 100644 --- a/libstdc++-v3/doc/html/manual/status.html +++ b/libstdc++-v3/doc/html/manual/status.html @@ -630,4 +630,4 @@ particular release.

+ Home License \ No newline at end of file diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml index a76b80c7bc0..2f558d2b7d7 100644 --- a/libstdc++-v3/doc/xml/manual/configure.xml +++ b/libstdc++-v3/doc/xml/manual/configure.xml @@ -288,10 +288,12 @@ --enable-concept-checks This turns on additional compile-time checks for instantiated - library templates, in the form of specialized templates, - described here. They + library templates, in the form of specialized templates described in + the Concept + Checking section. They can help users discover when they break the rules of the STL, before - their programs run. + their programs run. These checks are based on C++03 rules and some of + them are not compatible with correct C++11 code. diff --git a/libstdc++-v3/doc/xml/manual/diagnostics.xml b/libstdc++-v3/doc/xml/manual/diagnostics.xml index 99206e9fde9..88ed2e28057 100644 --- a/libstdc++-v3/doc/xml/manual/diagnostics.xml +++ b/libstdc++-v3/doc/xml/manual/diagnostics.xml @@ -114,8 +114,9 @@ Please note that the checks are based on the requirements in the original - C++ standard, some of which have changed in the new C++11 revision. - Additionally, some correct code might be rejected by the concept checks, + C++ standard, many of which were relaxed in the C++11 standard and so valid + C++11 code may be incorrectly rejected by the concept checks. Additionally, + some correct C++03 code might be rejected by the concept checks, for example template argument types may need to be complete when used in a template definition, rather than at the point of instantiation. There are no plans to address these shortcomings. diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 50570efbfa7..f674245b30d 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -829,7 +829,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { // concept requirements typedef typename _Alloc::value_type _Alloc_value_type; +#if __cplusplus < 201103L __glibcxx_class_requires(_Tp, _SGIAssignableConcept) +#endif __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) typedef _Deque_base<_Tp, _Alloc> _Base; diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h index 0ed212e4307..09dd6118a7a 100644 --- a/libstdc++-v3/include/bits/stl_stack.h +++ b/libstdc++-v3/include/bits/stl_stack.h @@ -100,8 +100,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // concept requirements typedef typename _Sequence::value_type _Sequence_value_type; +#if __cplusplus < 201103L __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) +#endif __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) template diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 8407a153f06..305d4465178 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -215,7 +215,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { // Concept requirements. typedef typename _Alloc::value_type _Alloc_value_type; +#if __cplusplus < 201103L __glibcxx_class_requires(_Tp, _SGIAssignableConcept) +#endif __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) typedef _Vector_base<_Tp, _Alloc> _Base;