[Bug c++/58435] New: Applying a type transformation to a list: const ignored
iavr at image dot ntua.gr
gcc-bugzilla@gcc.gnu.org
Mon Sep 16 14:30:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58435
Bug ID: 58435
Summary: Applying a type transformation to a list: const
ignored
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: iavr at image dot ntua.gr
The following applies a type transformation F to a list L of types T..., in
particular for a transformation that adds "const":
------------------------------------------------------------------------
template <template <typename...> class F, typename P> struct apply;
template <
template <typename...> class F,
template <typename...> class L, typename... T
> struct apply <F, L <T...> > { typedef L <F <T>...> type; };
template <typename T> using map = const T;
template <typename> struct A { };
template <typename> void dummy();
int main() { dummy <apply <map, A <int> >::type>(); }
------------------------------------------------------------------------
It fails to link because of
undefined reference to `void dummy<A<int> >()'
instead of the expected
undefined reference to `void dummy<A<const int> >()'
i.e., "const" is ignored. It works for any other transformation I have tried.
More information about the Gcc-bugs
mailing list