The command traits have a member NumArgs for which all the parsing
infrastructure is in place, but no command was setting it to a value
other than 0. By doing so we get warnings when passing an empty
paragraph to \retval (the first argument is the return value, then comes
the description). We also take \xrefitem along for the ride, although as
the documentation states it's unlikely to be used directly.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
Add an AST test to check that we parse the arguments correctly. (We don't use them for diagnostics currently.)
Comment Actions
Hello,
one of your three commits in https://github.com/llvm/llvm-project/compare/562ce1592456...d2396d896ee1 broke building on mac:
Please take a look, and revert for now if it takes a while to fix.
(Here's the error:
In file included from ../../clang/lib/AST/CommentParser.cpp:9: In file included from ../../clang/include/clang/AST/CommentParser.h:16: In file included from ../../clang/include/clang/AST/Comment.h:17: In file included from ../../clang/include/clang/AST/DeclObjC.h:16: In file included from ../../clang/include/clang/AST/Decl.h:19: In file included from ../../clang/include/clang/AST/DeclBase.h:18: In file included from ../../clang/include/clang/AST/DeclarationName.h:16: In file included from ../../clang/include/clang/AST/Type.h:21: In file included from ../../clang/include/clang/AST/NestedNameSpecifier.h:18: ../../clang/include/clang/Basic/Diagnostic.h:1353:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'const clang::StreamingDiagnostic' and 'typename remove_reference<unsigned long &>::type' (aka 'unsigned long')) DB << std::move(V); ~~ ^ ~~~~~~~~~~~~ ../../clang/lib/AST/CommentParser.cpp:417:57: note: in instantiation of function template specialization 'clang::DiagnosticBuilder::operator<<<unsigned long, void>' requested here << CommandTok.is(tok::at_command) << Info->Name << Args.size() ^ ../../clang/include/clang/Basic/Diagnostic.h:1400:35: note: candidate function inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, ^ ../../clang/include/clang/Basic/Diagnostic.h:1406:35: note: candidate function inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, ^ ../../clang/include/clang/Basic/Diagnostic.h:1422:35: note: candidate function inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, ^ ../../clang/include/clang/Basic/Diagnostic.h:1428:35: note: candidate function inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, ^ ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, unsigned long) DB << std::move(V); ^ ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, int) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, long long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, __int128) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, unsigned int) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, unsigned long long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(int, unsigned __int128) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(long, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(long long, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(__int128, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(unsigned int, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(unsigned long, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(unsigned long long, unsigned long) ../../clang/include/clang/Basic/Diagnostic.h:1353:8: note: built-in candidate operator<<(unsigned __int128, unsigned long)
)
Comment Actions
Looking at that error some more, it must've been D125429. Moving the comment over there, sorry for the noise.