public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55576] New: Fails to compile a call to template member function
@ 2012-12-03 15:27 antoshkka at gmail dot com
  2012-12-03 16:01 ` [Bug c++/55576] " redi at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: antoshkka at gmail dot com @ 2012-12-03 15:27 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55576
           Summary: Fails to compile a call to template member function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: antoshkka@gmail.com


Created attachment 28860
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28860
Output of `gcc -v -save-temps -Wall -Wextra main.cpp`

When compiling following code:

struct factory {
 template <typename T>
 void * apply(void * address)
 {
  return new (address) T;
 }
};

template <typename T>
struct apply {
 template <typename FactoryT>
 void* operator()(FactoryT const& f, void * address) {
  return f.template apply<T>(address);
 }
};

int main() {
 int place;
 apply<int>()(factory(), &place);
 return 0;
}


Tries to instantiate structure `apply` instead of calling a `factory` member
function `apply` (prints error: invalid use of ‘struct apply<T>’).


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

end of thread, other threads:[~2013-03-16  9:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 15:27 [Bug c++/55576] New: Fails to compile a call to template member function antoshkka at gmail dot com
2012-12-03 16:01 ` [Bug c++/55576] " redi at gcc dot gnu.org
2012-12-03 16:08 ` paolo.carlini at oracle dot com
2012-12-04  7:13 ` antoshkka at gmail dot com
2012-12-04  9:38 ` paolo.carlini at oracle dot com
2012-12-04 10:48 ` glisse at gcc dot gnu.org
2012-12-04 11:05 ` redi at gcc dot gnu.org
2012-12-06 14:39 ` antoshkka at gmail dot com
2012-12-06 15:47 ` redi at gcc dot gnu.org
2012-12-06 16:33 ` jason at gcc dot gnu.org
2012-12-13 18:02 ` tudorb at fb dot com
2012-12-13 18:04 ` tudorb at fb dot com
2013-02-25 14:07 ` potswa at mac dot com
2013-02-25 16:20 ` d.frey at gmx dot de
2013-03-16  9:45 ` 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).