from Fedora - Bug 2581961 - coan fails to build with gcc 17 snapshot: 'filebuf' in namespace 'std' does not name a type
coan fails to compile with the gcc 17 trunk snapshot on all built architectures:
io.h:225:21: error: 'filebuf' in namespace 'std' does not name a type
io.h:233:21: error: 'filebuf' in namespace 'std' does not name a type
make[2]: *** [Makefile:535: contradiction.o] Error 1
io.h uses std::filebuf without including <fstream>; GCC 17 no longer provides it transitively.</fstream>
Version-Release number of selected component (if applicable):
coan-6.0.1 (rawhide, coan-6.0.1-54.fc46 builds fine with gcc-16); gcc-17.0.0-999.20261120s.3.fc46
This is in preparation of the imminent gcc update for Fedora 46.
Reproducible: Always
Steps to Reproduce:
Build coan against the gcc-17 snapshot (Copr project @gcc-team/gcc-snapshot-20261120s): https://copr.fedorainfracloud.org/coprs/g/gcc-team/gcc-snapshot-20261120s/
Compilation of contradiction.o/dataset.o fails in io.h
Actual Results:
compile error — std::filebuf undeclared
Expected Results:
no compile error
Additional Information:
Fix: add #include <fstream> to io.h</fstream>
Patch:
--- a/src/io.h
+++ b/src/io.h
@@ -42,6 +42,7 @@
#include "filesys.h"
#include <string>
#include <cassert>
+#include <fstream></fstream></cassert></string>
/** \file io.h
struct io