mirror of git://gcc.gnu.org/git/gcc.git
				
				
				
			PR libstdc++/80762 avoid ambiguous __constructible_from<void, void>
Ensure we don't try to instantiate __is_constructible_from<void, void>, because there are two partial specializations that are equally good matches. PR libstdc++/80762 * include/bits/fs_path.h (path::_Path): Use remove_cv_t and is_void. * include/experimental/bits/fs_path.h (path::_Path): Likewise. * testsuite/27_io/filesystem/path/construct/80762.cc: New test. * testsuite/experimental/filesystem/path/construct/80762.cc: New test. From-SVN: r267056
This commit is contained in:
		
							parent
							
								
									5da5fefeeb
								
							
						
					
					
						commit
						6b7c0b5559
					
				|  | @ -1,3 +1,11 @@ | |||
| 2018-12-12  Jonathan Wakely  <jwakely@redhat.com> | ||||
| 
 | ||||
| 	PR libstdc++/80762 | ||||
| 	* include/bits/fs_path.h (path::_Path): Use remove_cv_t and is_void. | ||||
| 	* include/experimental/bits/fs_path.h (path::_Path): Likewise. | ||||
| 	* testsuite/27_io/filesystem/path/construct/80762.cc: New test. | ||||
| 	* testsuite/experimental/filesystem/path/construct/80762.cc: New test. | ||||
| 
 | ||||
| 2018-12-12  Jakub Jelinek  <jakub@redhat.com> | ||||
| 
 | ||||
| 	P0595R2 - is_constant_evaluated | ||||
|  |  | |||
|  | @ -110,7 +110,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 | |||
| 
 | ||||
|     template<typename _Tp1, typename _Tp2 = void> | ||||
|       using _Path = typename | ||||
| 	std::enable_if<__and_<__not_<is_same<_Tp1, path>>, | ||||
| 	std::enable_if<__and_<__not_<is_same<remove_cv_t<_Tp1>, path>>, | ||||
| 			      __not_<is_void<_Tp1>>, | ||||
| 			      __constructible_from<_Tp1, _Tp2>>::value, | ||||
| 		       path>::type; | ||||
| 
 | ||||
|  |  | |||
|  | @ -125,7 +125,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 | |||
| 
 | ||||
|     template<typename _Tp1, typename _Tp2 = void> | ||||
|       using _Path = typename | ||||
| 	std::enable_if<__and_<__not_<is_same<_Tp1, path>>, | ||||
| 	std::enable_if<__and_<__not_<is_same<typename remove_cv<_Tp1>::type, | ||||
| 					     path>>, | ||||
| 			      __not_<is_void<_Tp1>>, | ||||
| 			      __constructible_from<_Tp1, _Tp2>>::value, | ||||
| 		       path>::type; | ||||
| 
 | ||||
|  |  | |||
|  | @ -0,0 +1,29 @@ | |||
| // Copyright (C) 2018 Free Software Foundation, Inc.
 | ||||
| //
 | ||||
| // This file is part of the GNU ISO C++ Library.  This library is free
 | ||||
| // software; you can redistribute it and/or modify it under the
 | ||||
| // terms of the GNU General Public License as published by the
 | ||||
| // Free Software Foundation; either version 3, or (at your option)
 | ||||
| // any later version.
 | ||||
| 
 | ||||
| // This library is distributed in the hope that it will be useful,
 | ||||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | ||||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | ||||
| // GNU General Public License for more details.
 | ||||
| 
 | ||||
| // You should have received a copy of the GNU General Public License along
 | ||||
| // with this library; see the file COPYING3.  If not see
 | ||||
| // <http://www.gnu.org/licenses/>.
 | ||||
| 
 | ||||
| // { dg-options "-std=gnu++17" }
 | ||||
| // { dg-do compile { target c++17 } }
 | ||||
| 
 | ||||
| #include <filesystem> | ||||
| 
 | ||||
| using std::filesystem::path; | ||||
| 
 | ||||
| static_assert( !std::is_constructible_v<path, void> ); | ||||
| static_assert( !std::is_constructible_v<path, volatile path> ); | ||||
| static_assert( !std::is_constructible_v<path, volatile path&> ); | ||||
| static_assert( !std::is_constructible_v<path, const volatile path> ); | ||||
| static_assert( !std::is_constructible_v<path, const volatile path&> ); | ||||
|  | @ -0,0 +1,28 @@ | |||
| // Copyright (C) 2018 Free Software Foundation, Inc.
 | ||||
| //
 | ||||
| // This file is part of the GNU ISO C++ Library.  This library is free
 | ||||
| // software; you can redistribute it and/or modify it under the
 | ||||
| // terms of the GNU General Public License as published by the
 | ||||
| // Free Software Foundation; either version 3, or (at your option)
 | ||||
| // any later version.
 | ||||
| 
 | ||||
| // This library is distributed in the hope that it will be useful,
 | ||||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | ||||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | ||||
| // GNU General Public License for more details.
 | ||||
| 
 | ||||
| // You should have received a copy of the GNU General Public License along
 | ||||
| // with this library; see the file COPYING3.  If not see
 | ||||
| // <http://www.gnu.org/licenses/>.
 | ||||
| 
 | ||||
| // { dg-do compile { target c++11 } }
 | ||||
| 
 | ||||
| #include <experimental/filesystem> | ||||
| 
 | ||||
| using std::experimental::filesystem::path; | ||||
| 
 | ||||
| static_assert( !std::is_constructible<path, void>::value, "" ); | ||||
| static_assert( !std::is_constructible<path, volatile path>::value, "" ); | ||||
| static_assert( !std::is_constructible<path, volatile path&>::value, "" ); | ||||
| static_assert( !std::is_constructible<path, const volatile path>::value, "" ); | ||||
| static_assert( !std::is_constructible<path, const volatile path&>::value, "" ); | ||||
		Loading…
	
		Reference in New Issue
	
	 Jonathan Wakely
						Jonathan Wakely