public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47329] New: cc1plus segfaults when using variadic function template
@ 2011-01-17 16:04 gmaizel at gmail dot com
2011-01-18 10:50 ` [Bug c++/47329] " redi at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: gmaizel at gmail dot com @ 2011-01-17 16:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47329
Summary: cc1plus segfaults when using variadic function
template
Product: gcc
Version: 4.4.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gmaizel@gmail.com
g++ reports segfault in cc1plus when attempting to compile code sample provided
below:
$ g++ -std=c++0x -o test test.cpp
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
$ g++ --version
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
------ test.cpp -----------------------
# include <iostream>
# include <vector>
void print(const std::vector<int>& pack)
{
for(size_t i=0; i<pack.size(); i++)
std::cout << pack[i] << " ";
std::cout << "\n";
}
template<typename ...Vals>
void print(std::vector<int>& pack, int v1, Vals... vals)
{
pack.push_back(v1);
print(pack, vals...);
}
template<typename ...Vals>
void print(Vals... vals)
{
std::vector<int> pack;
print(pack, vals...);
}
int main()
{
print(1);
print("a"); // <-- this line triggers the failure
print(2, 3, 4, 5);
print(6, 7);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/47329] cc1plus segfaults when using variadic function template
2011-01-17 16:04 [Bug c++/47329] New: cc1plus segfaults when using variadic function template gmaizel at gmail dot com
@ 2011-01-18 10:50 ` redi at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-18 10:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47329
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WORKSFORME
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-18 10:25:08 UTC ---
I can't reproduce an ICE with FSF 4.4.3, 4.4.5, or 4.5/4.6 from svn, instead I
get a diagnostic as expected because the code is invalid.
Maybe you are hitting a bug in the Ubuntu package, in which case it should be
reported to Ubuntu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-18 10:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 16:04 [Bug c++/47329] New: cc1plus segfaults when using variadic function template gmaizel at gmail dot com
2011-01-18 10:50 ` [Bug c++/47329] " redi 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).