Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cursor/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

5 changes: 5 additions & 0 deletions .gemini/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

3 changes: 2 additions & 1 deletion lang/c++/include/avro/Node.hh
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ inline std::ostream &operator<<(std::ostream &os, const avro::Node &n) {

template<>
struct std::formatter<avro::Name, char> : std::formatter<std::string, char> {
auto format(const avro::Name &n, std::format_context &ctx) const {
template<typename FormatContext>
auto format(const avro::Name &n, FormatContext &ctx) const {
return std::formatter<std::string, char>::format(n.fullname(), ctx);
}
Comment on lines +228 to 231

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Does C++23 require std::formatter specializations to use a template FormatContext parameter instead of std::format_context in the format method signature?

💡 Result:

No, C++23 does not require std::formatter specializations to use a template FormatContext parameter in the format method signature [1]. The standard requirements for a formatter specialization [2][1] specify that the format method must accept a context object of type std::basic_format_context<OutputIt, CharT> [3][2][1]. In practice, you may either explicitly use the concrete type (such as std::format_context) [4][5] or use a template parameter to make the formatter more generic [6][1]. Specifically, the Formatter requirements [1] state that given a formatter object f, an lvalue arg of type Arg, and an lvalue fc of type basic_format_context<OutputIt, CharT>, the expression f.format(arg, fc) must be valid and return an object of type basic_format_context<OutputIt, CharT>::iterator [2][1]. Because std::format_context is a type alias for std::basic_format_context<std::back_insert_iteratorstd::string, char> (or the wide character equivalent) [3][7], using it in your signature restricts your formatter to that specific context [4][5]. Using a template parameter for the context allows your formatter to work with different output iterators and contexts [6][1], but it is not a requirement imposed by the standard [1]. You are free to write the signature as: auto format(const T& val, std::format_context& ctx) const; or template auto format(const T& val, FormatContext& ctx) const; Both are valid, provided they meet the semantic requirements of the Formatter interface [2][1].

Citations:


Clarify C++23 std::formatter::format signature requirements (optional change)
C++23 doesn’t require the format method to use a templated FormatContext&; the requirement is that it accepts a std::basic_format_context<OutputIt, CharT>&std::format_context is an allowed concrete alias. For lang/c++/include/avro/Node.hh:228-231, ensure the C++23 build failure you’re targeting is actually caused by the format signature mismatch (otherwise the template generalization is just an optional flexibility improvement).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lang/c`++/include/avro/Node.hh around lines 228 - 231, The current templated
FormatContext signature on the member formatter for avro::Name (the format
method in Node.hh) may not match the C++23 requirement; replace the template
with a concrete allowed context type—either accept std::format_context& ctx or
define the signature as template<typename CharT, typename OutputIt> auto
format(const avro::Name &n, std::basic_format_context<OutputIt, CharT> &ctx)
const—then call std::formatter<std::string, CharT>::format(n.fullname(), ctx);
also confirm the failing C++23 build error is actually triggered by this
signature mismatch before changing anything else.

};
Expand Down
3 changes: 2 additions & 1 deletion lang/c++/include/avro/Types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ std::ostream &operator<<(std::ostream &os, const Null &null);

template<>
struct std::formatter<avro::Type, char> : std::formatter<std::string, char> {
auto format(avro::Type t, std::format_context &ctx) const {
template<typename FormatContext>
auto format(avro::Type t, FormatContext &ctx) const {
return std::formatter<std::string, char>::format(avro::toString(t), ctx);
}
};
Expand Down
Loading