FS#61882 - [gcc]g++: internal compiler error: Segmentation fault signal terminated program cc1plus
Attached to Project:
Arch Linux
Opened by Mohammad Nasirifar (farnasirim) - Wednesday, 27 February 2019, 18:40 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:14 GMT
Opened by Mohammad Nasirifar (farnasirim) - Wednesday, 27 February 2019, 18:40 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:14 GMT
|
Details
Compile with `-fconcepts`. Changing `o<<a` to
`operator<<(o, a)` makes the program compile
correctly.
#include <vector> #include <iostream> template<typename Container> concept bool Iterable = requires(Container t) { { *t.begin()++, t.end() }; }; template<Iterable T> requires !requires(std::ostream o, T a) { o<<a; } std::ostream& operator<<(std::ostream& out, const T& t) { for(const auto& it: t) { out << it << " " ; } return out; } int main() { std::vector<int> a = {1, 2, 3}; std::cout << a << std::endl; std::string str = "something"; std::cout << str << std::endl; // compile error if the template is defined return 0; } |
This task depends upon
Closed by Bartłomiej Piotrowski (Barthalion)
Monday, 11 May 2020, 07:14 GMT
Reason for closing: Upstream
Monday, 11 May 2020, 07:14 GMT
Reason for closing: Upstream
FS#61873why did you open a new bug report?The error messages are also different if you look closely.
Edit:
I apologize for not comparing both bug reports in detail.
Edit2:
Tried both proof of concepts with g++ 9.0.1.r167568.c70a6d7d649 both still failed with ICE.