https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63528

            Bug ID: 63528
           Summary: A variadic variable template cannot use the ::value of
                    a variadic trait
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com
                CC: jason at redhat dot com

Created attachment 33702
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33702&action=edit
Preprocessed testcase

#include <type_traits>

static_assert(std::is_constructible<int, int>::value, "");

template <class T, class... Args>
constexpr bool is_constructible_v = std::is_constructible<T, Args...>::value;

static_assert(is_constructible_v<int, int>, "");

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr/local --enable-languages=c,c++ :
(reconfigured) ../configure --prefix=/usr/local --enable-languages=c,c++
Thread model: posix
gcc version 5.0.0 20141013 (experimental) (GCC) 

COLLECT_GCC_OPTIONS='-std=c++14' '-v' '-save-temps' '-c' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/cc1plus -E -quiet -v
-D_GNU_SOURCE variable-template-isconstructible.cpp -mtune=generic
-march=x86-64 -std=c++14 -fpch-preprocess -o
variable-template-isconstructible.ii
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../include/c++/5.0.0

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../include/c++/5.0.0/x86_64-unknown-linux-gnu

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/../../../../include/c++/5.0.0/backward
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-std=c++14' '-v' '-save-temps' '-c' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/cc1plus -fpreprocessed
variable-template-isconstructible.ii -quiet -dumpbase
variable-template-isconstructible.cpp -mtune=generic -march=x86-64 -auxbase
variable-template-isconstructible -std=c++14 -version -o
variable-template-isconstructible.s
GNU C++ (GCC) version 5.0.0 20141013 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 5.0.0 20141013 (experimental), GMP version 5.0.2,
MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 5.0.0 20141013 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 5.0.0 20141013 (experimental), GMP version 5.0.2,
MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 50a3aa5021e9015dd41af708b42ad2d3
variable-template-isconstructible.cpp:8:1: error: non-constant condition for
static assertion
 static_assert(is_constructible_v<int, int>, "");
 ^
variable-template-isconstructible.cpp:8:1: error: the value of
‘is_constructible_v<int, <expression error> >’ is not usable in a constant
expression
variable-template-isconstructible.cpp:6:16: note: ‘is_constructible_v<int,
<expression error> >’ used in its own initializer
 constexpr bool is_constructible_v = std::is_constructible<T, Args...>::value;

Reply via email to