diff mbox series

[v3] Protect optional's deduction guide with the feature macro

Message ID CAFk2RUYAO-tRF-KXHSnAayZpxWU-qsrVEGHjx-DXzna56Xd5-Q@mail.gmail.com
State New
Headers show
Series [v3] Protect optional's deduction guide with the feature macro | expand

Commit Message

Ville Voutilainen Jan. 3, 2018, 2:34 p.m. UTC
Tested partially on Linux-x64, finishing testing the full suite on
Linux-PPC64. Ok for trunk?

2018-01-03  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Protect optional's deduction guide with the feature macro
    * include/std/optional: Use the feature macro.

Comments

Jonathan Wakely Jan. 3, 2018, 7:57 p.m. UTC | #1
On 03/01/18 16:34 +0200, Ville Voutilainen wrote:
>Tested partially on Linux-x64, finishing testing the full suite on
>Linux-PPC64. Ok for trunk?

Yes, and gcc-7-branch please. Thanks.
diff mbox series

Patch

diff --git a/libstdc++-v3/include/std/optional b/libstdc++-v3/include/std/optional
index e017eed..f7c72b5 100644
--- a/libstdc++-v3/include/std/optional
+++ b/libstdc++-v3/include/std/optional
@@ -1038,7 +1038,9 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// @}
 
+#if __cpp_deduction_guides >= 201606
   template <typename _Tp> optional(_Tp) -> optional<_Tp>;
+#endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std