FS#61873 - [gcc]internal compiler error: in cp_parser_lookup_name, at cp/parser.c:26145
Attached to Project:
Arch Linux
Opened by Mohammad Nasirifar (farnasirim) - Wednesday, 27 February 2019, 03:16 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:11 GMT
Opened by Mohammad Nasirifar (farnasirim) - Wednesday, 27 February 2019, 03:16 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 11 May 2020, 07:11 GMT
|
Details
// Code:
#include <bits/stdc++.h> using namespace std; template<template<typename> typename Container, typename DataType> concept bool Iterable = requires(Container<DataType> t) { { *t.begin() } -> DataType; }; template<typename T> ostream& operator<<(ostream& out, const Iterable<T>& t) { for(auto it: t) { out << it << " " ; } return out; } int main() { return 0; } /* end code gcc version: 8.2.1+20181127-1 Clearly this should not compile, but I still do not expect an internal error. */ |
This task depends upon
Closed by Bartłomiej Piotrowski (Barthalion)
Monday, 11 May 2020, 07:11 GMT
Reason for closing: Fixed
Additional comments about closing: 10.1.0-1
Monday, 11 May 2020, 07:11 GMT
Reason for closing: Fixed
Additional comments about closing: 10.1.0-1
foo.cpp:8:1: error: ‘concept’ does not name a type
concept bool Iterable = requires(Container<DataType> t) {
^~~~~~~
foo.cpp:8:1: note: ‘concept’ only available with -fconcepts
foo.cpp:13:41: error: ‘Iterable’ does not name a type; did you mean ‘mutable’?
ostream& operator<<(ostream& out, const Iterable<T>& t) {
^~~~~~~~
mutable
foo.cpp:13:49: error: expected ‘,’ or ‘...’ before ‘<’ token
ostream& operator<<(ostream& out, const Iterable<T>& t) {
^
foo.cpp: In function ‘std::ostream& operator<<(std::ostream&, int)’:
foo.cpp:14:18: error: ‘t’ was not declared in this scope
for(auto it: t) {
^
foo.cpp:14:18: note: suggested alternative: ‘it’
for(auto it: t) {
^
it
No ICE in sight...
```
g++ nth-order-statistic.cpp -Wall -fconcepts
```
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85991