public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error
@ 2013-06-04 15:38 markus.mayr at outlook dot com
2013-06-04 15:39 ` [Bug c++/57527] " markus.mayr at outlook dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: markus.mayr at outlook dot com @ 2013-06-04 15:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
Bug ID: 57527
Summary: [C++11] Nested variadic templates cause internal
compiler error
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: markus.mayr at outlook dot com
I do not know whether the following program is supposed to compile according to
the standard. I only know that it compiles using clang and that it causes an
internal compiler error. I use a variadic template constructor within a
variadic template class and expand both parameter packs simultaneously.
struct Z {};
template <class Arg, unsigned int N>
struct X {};
template <class... Args>
struct Y
{
template <unsigned int... N>
Y( X<Args, N>... xs )
{}
};
int main( int argc, char **argv )
{
X<Z,1> x;
Y<Z> y( x );
return 0;
}
Instantiating the constructor causes an internal compiler error:
t.cpp: In function 'int main(int, char**)':
t.cpp:16:25: internal compiler error: in unify, at cp/pt.c:16369
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://trac.macports.org/newticket> for instructions.
If x is replaced by a temporary, the code compiles, i.e. replacing main() by
int main( int argc, char **argv )
{
Y<Z> y( X<Z,1> x );
return 0;
}
compiles. Turning x into an rvalue reference, however, does not compile.
I added the code as an attachment. My compiler version is g++-4.7.2, but I am
currently compiling a more recent version of g++ (4.8.0) to test this. I tested
the code on Mac OS X and Debian GNU/Linux. As already mentioned, clang++ seems
to accept the code. As a side note, I would also be interested in a workaround
for enumerating arguments in a parameter pack provided that there might be
arguments of the same type in the pack.
I hope that this bug is new to you.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/57527] [C++11] Nested variadic templates cause internal compiler error
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
@ 2013-06-04 15:39 ` markus.mayr at outlook dot com
2013-06-04 15:48 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: markus.mayr at outlook dot com @ 2013-06-04 15:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
--- Comment #1 from markus.mayr at outlook dot com ---
Created attachment 30257
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30257&action=edit
Source code example.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/57527] [C++11] Nested variadic templates cause internal compiler error
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
2013-06-04 15:39 ` [Bug c++/57527] " markus.mayr at outlook dot com
@ 2013-06-04 15:48 ` redi at gcc dot gnu.org
2013-06-04 20:52 ` daniel.kruegler at googlemail dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2013-06-04 15:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-06-04
Ever confirmed|0 |1
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Possibly a dup of Bug 54090 but fails at a different place
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/57527] [C++11] Nested variadic templates cause internal compiler error
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
2013-06-04 15:39 ` [Bug c++/57527] " markus.mayr at outlook dot com
2013-06-04 15:48 ` redi at gcc dot gnu.org
@ 2013-06-04 20:52 ` daniel.kruegler at googlemail dot com
2021-11-08 9:24 ` pinskia at gcc dot gnu.org
2024-02-16 22:26 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-06-04 20:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This problem still exists in gcc 4.9.0 20130519 (experimental). The
corresponding error message here is:
"main.cpp|15|required from here|
main.cpp|15|internal compiler error: in unify, at cp/pt.c:16742"
>From gcc-bugs-return-423816-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 04 22:07:15 2013
Return-Path: <gcc-bugs-return-423816-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19721 invoked by alias); 4 Jun 2013 22:07:15 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19686 invoked by uid 48); 4 Jun 2013 22:07:08 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57357] Error with '-mno-sse' and include wchar.h
Date: Tue, 04 Jun 2013 22:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-57357-4-499W4ftzBJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57357-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57357-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg00195.txt.bz2
Content-length: 556
http://gcc.gnu.org/bugzilla/show_bug.cgi?idW357
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since glibc controls the headers we (GCC) project cannot do anything. Why are
you using -mno-sse on an user space application anyways?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/57527] [C++11] Nested variadic templates cause internal compiler error
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
` (2 preceding siblings ...)
2013-06-04 20:52 ` daniel.kruegler at googlemail dot com
@ 2021-11-08 9:24 ` pinskia at gcc dot gnu.org
2024-02-16 22:26 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-08 9:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102871 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/57527] [C++11] Nested variadic templates cause internal compiler error
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
` (3 preceding siblings ...)
2021-11-08 9:24 ` pinskia at gcc dot gnu.org
@ 2024-02-16 22:26 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-16 22:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57527
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
// PR c++/57527
template <class Arg, unsigned int N>
struct X {};
template <class... Args>
struct Y {
template <unsigned int... N>
Y(X<Args, N>... xs);
};
void
g ()
{
X<int, 1> x;
Y<int> y(x);
}
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-16 22:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04 15:38 [Bug c++/57527] New: [C++11] Nested variadic templates cause internal compiler error markus.mayr at outlook dot com
2013-06-04 15:39 ` [Bug c++/57527] " markus.mayr at outlook dot com
2013-06-04 15:48 ` redi at gcc dot gnu.org
2013-06-04 20:52 ` daniel.kruegler at googlemail dot com
2021-11-08 9:24 ` pinskia at gcc dot gnu.org
2024-02-16 22:26 ` mpolacek 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).