-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Support] Ensure complete type DelimitedScope #127459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
@llvm/pr-subscribers-llvm-support Author: Jonas Hahnfeld (hahnjo) Changes
Full diff: https://github.com/llvm/llvm-project/pull/127459.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index 419ab97366796..506b40a09ed78 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -539,7 +539,13 @@ ScopedPrinter::printHex<support::ulittle16_t>(StringRef Label,
startLine() << Label << ": " << hex(Value) << "\n";
}
-struct DelimitedScope;
+struct DelimitedScope {
+ DelimitedScope(ScopedPrinter &W) : W(&W) {}
+ DelimitedScope() : W(nullptr) {}
+ virtual ~DelimitedScope() = default;
+ virtual void setPrinter(ScopedPrinter &W) = 0;
+ ScopedPrinter *W;
+};
class JSONScopedPrinter : public ScopedPrinter {
private:
@@ -838,14 +844,6 @@ class JSONScopedPrinter : public ScopedPrinter {
}
};
-struct DelimitedScope {
- DelimitedScope(ScopedPrinter &W) : W(&W) {}
- DelimitedScope() : W(nullptr) {}
- virtual ~DelimitedScope() = default;
- virtual void setPrinter(ScopedPrinter &W) = 0;
- ScopedPrinter *W;
-};
-
struct DictScope : DelimitedScope {
explicit DictScope() = default;
explicit DictScope(ScopedPrinter &W) : DelimitedScope(W) { W.objectBegin(); }
|
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 TODO: needs a tag
Thanks @dwblaikie for merging. In the future, I would prefer to merge PRs myself though because now the commit in the repository has the wrong email address (my work one, not my private dev address as I contributed this outside work time). I was very surprised this morning to have 60+ emails in my work inbox from buildbots (not this change though)... |
Ah, sure thing - I'll try to keep that in mind. |
/cherry-pick e65d388 |
/pull-request #128686 |
`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. (cherry picked from commit e65d388)
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
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
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
JSONScopedPrinter
has astd::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.