Skip to content

Commit 019b5eb

Browse files
committed
[llvm-project][Support] Ensure complete type DelimitedScope
JSONScopedPrinter has a std::unique_ptr<DelimitedScope> member and defaulted constructor argument, so it needs a complete type. This resolves one of the many build errors with C++23 using Clang. Backport of llvm/llvm-project#127459
1 parent 760ff54 commit 019b5eb

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ROOT-llvm18-20250225-01
1+
ROOT-llvm18-20250313-01

interpreter/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,13 @@ ScopedPrinter::printHex<support::ulittle16_t>(StringRef Label,
539539
startLine() << Label << ": " << hex(Value) << "\n";
540540
}
541541

542-
struct DelimitedScope;
542+
struct DelimitedScope {
543+
DelimitedScope(ScopedPrinter &W) : W(&W) {}
544+
DelimitedScope() : W(nullptr) {}
545+
virtual ~DelimitedScope() = default;
546+
virtual void setPrinter(ScopedPrinter &W) = 0;
547+
ScopedPrinter *W;
548+
};
543549

544550
class JSONScopedPrinter : public ScopedPrinter {
545551
private:
@@ -838,14 +844,6 @@ class JSONScopedPrinter : public ScopedPrinter {
838844
}
839845
};
840846

841-
struct DelimitedScope {
842-
DelimitedScope(ScopedPrinter &W) : W(&W) {}
843-
DelimitedScope() : W(nullptr) {}
844-
virtual ~DelimitedScope() = default;
845-
virtual void setPrinter(ScopedPrinter &W) = 0;
846-
ScopedPrinter *W;
847-
};
848-
849847
struct DictScope : DelimitedScope {
850848
explicit DictScope() = default;
851849
explicit DictScope(ScopedPrinter &W) : DelimitedScope(W) { W.objectBegin(); }

0 commit comments

Comments
 (0)