ut
ut copied to clipboard
The 'struct override{}' causes compilation failure
Hello, this line is causing my compilation to fail to compile.
It happens when my test includes libfmt:
home/badamson/projects/rrogue/source/external/fmt/include/fmt/format.h:328:33: error: two or more data types in declaration of ‘type name’
328 | auto overflow(int_type ch) -> int_type override {
| ^~~~~~~~
/home/badamson/projects/rrogue/source/external/fmt/include/fmt/format.h:334:56: error: two or more data types in declaration of ‘type name’
334 | auto xsputn(const char_type* s, streamsize count) -> streamsize override {
The output is misleading, the cause over the error is because inside ut.hpp there is a 'struct override'. I don't know if this is a bug in gcc (it only happens when I build in release mode) but would you consider a different name than override for the struct here?
I forgot to add, changing the name of the struct to anything else fixes the issue.