flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
229 stars 48 forks source link

Outline operator<< for CharBlock. #916

Closed DavidTruby closed 4 years ago

DavidTruby commented 4 years ago

This fixes an issue where the Dump function definitions in dump.cc were relying on the forward declaration of operator<< for CharBlock which was marked inline and only present in char-block.h.

This is not allowed under section 6.2.10 of the C++17 standard, and caused a compilation failure when building with clang 9 as this was (validly) inlining every use of the function and therefore not generating an outlined definition for linking.

DavidTruby commented 4 years ago

@kiranchandramohan on reflection iosfwd is still needed in the header, as the header still has to have a forward declaration of operator<< and needs those symbols there

kiranchandramohan commented 4 years ago

@kiranchandramohan on reflection iosfwd is still needed in the header, as the header still has to have a forward declaration of operator<< and needs those symbols there

Thanks for looking into this. No change needed then.