For the following code
#include <array>
template<unsigned MaxP, typename type>
struct kernel
{
static constexpr unsigned max_pole(unsigned P)
{ return P>MaxP? MaxP:P; }
template<unsigned P>
using array = std::array<type,max_pole(P)>; // wrong?
template<unsigned P>
static void do_something(array<P> const&, array<P>&);
};
gcc 4.7.0 (g++ -c -std=c++11) gives
error: ‘max_pole’ was not declared in this scope
Is this correct (behaviour of the compiler)? Note that if I resolve max_pole
by replacing it with kernel::max_pole
on the line indicated, it compiles fine.
EDIT Reported to bugzilla, accepted as bug c++/55992, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55992. Also occurs with gcc 4.7.x and 4.8.0.
g++ 4.7.2
Someone has a newer version like 4.8? Maybe this is a bug which was fixed... – Hoptoad