diff options
author | Jonathan Wakely <redi@gcc.gnu.org> | 2018-01-25 15:24:39 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-01-25 15:24:39 +0000 |
commit | 58078de77b2b22bb36d28daf2a7fe79397d5f057 (patch) | |
tree | 26925a26a22bce5f098941619e4442132d1b364d | |
parent | e3b18df45bd8fe4d4fa154d8f52e05ebb4a81da8 (diff) | |
download | gcc-58078de77b2b22bb36d28daf2a7fe79397d5f057.zip gcc-58078de77b2b22bb36d28daf2a7fe79397d5f057.tar.gz gcc-58078de77b2b22bb36d28daf2a7fe79397d5f057.tar.bz2 |
PR libstdc++/81076 make __byte_operand SFINAE-friendly
PR libstdc++/81076
* include/c_global/cstddef (__byte_operand): Define primary template.
* testsuite/18_support/byte/81076.cc: New test.
From-SVN: r257050
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/c_global/cstddef | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/byte/81076.cc | 26 |
3 files changed, 34 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 023e129..c856221 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,7 +1,13 @@ +2018-01-25 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/81076 + * include/c_global/cstddef (__byte_operand): Define primary template. + * testsuite/18_support/byte/81076.cc: New test. + 2018-01-19 Christophe Lyon <christophe.lyon@linaro.org> * testsuite/ext/special_functions/airy_ai/check_nan.cc: Fix - dg-options and dg-add-options order. + dg-options and dg-add-options order. * testsuite/ext/special_functions/airy_bi/check_nan.cc: Likewise. * testsuite/ext/special_functions/conf_hyperg/check_nan.cc: Likewise. diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef index af36cc0..36d7d71 100644 --- a/libstdc++-v3/include/c_global/cstddef +++ b/libstdc++-v3/include/c_global/cstddef @@ -65,7 +65,7 @@ namespace std /// std::byte enum class byte : unsigned char {}; - template<typename _IntegerType> struct __byte_operand; + template<typename _IntegerType> struct __byte_operand { }; template<> struct __byte_operand<bool> { using __type = byte; }; template<> struct __byte_operand<char> { using __type = byte; }; template<> struct __byte_operand<signed char> { using __type = byte; }; diff --git a/libstdc++-v3/testsuite/18_support/byte/81076.cc b/libstdc++-v3/testsuite/18_support/byte/81076.cc new file mode 100644 index 0000000..0ba0b12 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/byte/81076.cc @@ -0,0 +1,26 @@ +// 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 <cstddef> + +template<class> void to_integer(...); + +using T = decltype(to_integer<void* const>(std::byte{})); +using T = void; |