Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Outline operator<< for CharBlock. (flang-compiler/f18#916)
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 inlining every use of the function and therefore not generating an outlined definition for linking. Original-commit: flang-compiler/f18@3ad75d1 Reviewed-on: flang-compiler/f18#916
- Loading branch information
1 parent
d731aef
commit 05bdb54
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- lib/parser/char-block.cc --------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//----------------------------------------------------------------------------// | ||
|
||
#include "char-block.h" | ||
#include <ostream> | ||
|
||
namespace Fortran::parser { | ||
|
||
std::ostream &operator<<(std::ostream &os, const CharBlock &x) { | ||
return os << x.ToString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters