https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65706
Andreas Herrmann andreash87 at gmx dot ch changed:
What|Removed |Added
CC||andreash87 at gmx dot ch
--- Comment #2 from Andreas Herrmann andreash87 at gmx dot ch ---
I just stumbled up this problem in GCC 5.2.0. And it seems that Bug 66336 is a
duplicate of this one.
$ g++ --version
g++ (GCC) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cat bug.cc
template class T, T value_
struct constant {
using type = T;
static constexpr T value = value_;
};
template class Constant
constexpr typename Constant::type get = Constant::value;
template class... Args
void callme(Args...) {}
template class... Args
void works(Args...) {
callme(Args::value...);
}
template class... Args
void fails(Args...) {
callme(getArgs...); // !!! Parameter pack is not expanded.
}
int main() {
int x = getconstantint, 1; // The variable template works on its own.
works(constantint, 0{}, constantint, 1{});
fails(constantint, 0{}, constantint, 1{});
}
$ g++ -std=c++14 bug.cc
bug.cc: In function ‘void fails(Args ...)’:
bug.cc:20:21: error: expansion pattern ‘getArgs’ contains no argument packs
callme(getArgs...); // !!! Parameter pack is not expanded.