g++-4.8.4, Ubuntu 14.04, internal compiler error: in unify, at cp/pt.c

Bug #1482601 reported by emiddell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.8 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,
I' running Ubuntu 14.04.3 LTS and have the package g++4:4.8.2-1ubuntu6 installed.

When trying to compile the following snippet I get an internal compiler error.

---

#include <string>
#include <iostream>

template <typename ... Args>
std::string build_string(std::string fmt, std::initializer_list<Args...> args) {
    for (const auto& arg : args) {
        // use arg to build string
    }

    return "foo";
}

int main() {
    build_string("%.2f and %s", {3.14, "Hello"} );
}

---

The compiler flags were:
g++ -o bla --std=c++11 bla.cxx

The obtained error message is:

bla.cxx: In function ‘int main()’:
bla.cxx:17:49: internal compiler error: in unify, at cp/pt.c:17258
     build_string("%.2f and %s", {3.14, "Hello"} );
                                                 ^
Please submit a full bug report.

Revision history for this message
emiddell (eike-h) wrote :

This is the preprocessed source.

Revision history for this message
emiddell (eike-h) wrote :

changed affected package from gcc-4.8 to g++-4.8

Revision history for this message
Matthias Klose (doko) wrote :

gcc --version ?

Revision history for this message
emiddell (eike-h) wrote :

gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.