http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55993



Jonathan Wakely <redi at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

           Keywords|                            |rejects-valid

          Component|libstdc++                   |c++

            Summary|tuple_cat not a constant    |[C++11] derived-to-base

                   |expression for result size  |conversion fails in

                   |>= 3                        |constant expression

      Known to fail|                            |4.6.3, 4.7.3, 4.8.0



--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-15 
19:15:36 UTC ---

This seems to be a C++ front end bug, here's the code reduced to remove library

dependencies:



template<int N, typename T>

struct Head : T

{ };



template<int N, typename... T>

struct Tuple;



template<int N>

struct Tuple<N>

{ };



template<int N, typename T, typename... U>

struct Tuple<N, T, U...> : Tuple<N+1, U...>, Head<N, T>

{ };



template<typename T, typename U>

struct tuple : Tuple<0, T, U>

{ };



struct A { };

constexpr tuple<A, A> t{};

constexpr auto a = static_cast<const Head<0, A>&>(t);





tt.cc:22:52: error: accessing value of 't' through a 'const Head<0, A>' glvalue

in a constant expression

 constexpr auto a = static_cast<const Head<0, A>&>(t);

                                                    ^

Reply via email to