public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53498] New: Compiler crashes during C++11 template magic compilation
@ 2012-05-27 13:58 o.mangold at googlemail dot com
  2012-05-27 15:33 ` [Bug c++/53498] " daniel.kruegler at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: o.mangold at googlemail dot com @ 2012-05-27 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53498
           Summary: Compiler crashes during C++11 template magic
                    compilation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: o.mangold@googlemail.com


I was trying to create some template magic to create a check for the existence
of a function with variable number of arguments in C++11. Honestly, I don't
know, if my code should compile through, as the problem happened when I was
trying to figure out how to make it work. I got a compiler crash (which I guess
shouldn't happen in any case). I cooked it down to the example below:

> g++ -std=c++11 Crash.cxx

g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
kiwi/SafePrintf$g++ -std=c++11 Crash.cxx 
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
---

--- Crash.cxx ---
template<typename... ARGS>
class A
{
public:
  template<typename U>
  auto a(const U& u,const ARGS&... args,int) -> decltype(u.print(args...))

  {
  }
  template<typename U>
  int a(const U& u,const ARGS&... args,...)

  {
  }

};

template<typename... ARGS>
class B
{
public:
  template<typename U> static void
  b(const U& u,const ARGS&... args,
    decltype(A<ARGS...>::a(u,args...,0)) dummy)
  {
  }
};

int main() {

  B<int> dummy;

  return 0;
}


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

end of thread, other threads:[~2012-06-26  3:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-27 13:58 [Bug c++/53498] New: Compiler crashes during C++11 template magic compilation o.mangold at googlemail dot com
2012-05-27 15:33 ` [Bug c++/53498] " daniel.kruegler at googlemail dot com
2012-05-27 16:01 ` o.mangold at googlemail dot com
2012-05-27 16:45 ` daniel.kruegler at googlemail dot com
2012-06-26  3:43 ` jason at gcc dot gnu.org
2012-06-26  3:46 ` jason at gcc dot gnu.org
2012-06-26  3:47 ` jason at gcc dot gnu.org

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).