This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59550] New: compiler crash when forming a pointer to a reference would be needed in std::initalizer_list
- From: "ali.baharev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Dec 2013 19:57:57 +0000
- Subject: [Bug c++/59550] New: compiler crash when forming a pointer to a reference would be needed in std::initalizer_list
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59550
Bug ID: 59550
Summary: compiler crash when forming a pointer to a reference
would be needed in std::initalizer_list
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ali.baharev at gmail dot com
Code:
#include <fstream>
#include <initializer_list>
using namespace std;
void writeSomething(initializer_list<ofstream&> args) {
for (auto f : args )
f << "hello" << endl;
}
int main() {
ofstream outputFile("data_1.txt");
writeSomething({outputFile});
}
Online demonstration:
http://ideone.com/vTHDFy
This code came up at
http://stackoverflow.com/q/20665699/341970