Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/template/partial-specialization6.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/80174 typedef unsigned char uint8_t; template <typename T> struct HighestMaxFieldIdx { static const uint8_t maxFieldIdx = T::fieldIdx; }; template <typename This> struct Outer { template <uint8_t _fieldIdx, typename T, T This::*field> struct Varint {}; template <uint8_t _fieldIdx, uint8_t This::*field> struct Varint<_fieldIdx, uint8_t, field> { static const uint8_t fieldIdx = _fieldIdx; }; }; struct Msg { uint8_t a; static const uint8_t t = HighestMaxFieldIdx<Outer<Msg>::Varint<1, uint8_t, &Msg::a> >::maxFieldIdx; };