public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "o.mangold at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53498] New: Compiler crashes during C++11 template magic compilation
Date: Sun, 27 May 2012 13:58:00 -0000 [thread overview]
Message-ID: <bug-53498-4@http.gcc.gnu.org/bugzilla/> (raw)
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;
}
next reply other threads:[~2012-05-27 12:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-27 13:58 o.mangold at googlemail dot com [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-53498-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).