public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58435] New: Applying a type transformation to a list: const ignored
@ 2013-09-16 14:30 iavr at image dot ntua.gr
  2013-09-16 15:37 ` [Bug c++/58435] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: iavr at image dot ntua.gr @ 2013-09-16 14:30 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-19 18:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16 14:30 [Bug c++/58435] New: Applying a type transformation to a list: const ignored iavr at image dot ntua.gr
2013-09-16 15:37 ` [Bug c++/58435] " redi at gcc dot gnu.org
2013-09-16 18:27 ` paolo.carlini at oracle dot com
2013-09-16 19:29 ` paolo.carlini at oracle dot com
2013-09-17 18:39 ` paolo.carlini at oracle dot com
2013-09-17 18:40 ` paolo at gcc dot gnu.org
2013-09-19 18:26 ` iavr at image dot ntua.gr
2013-09-19 18:31 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).