[PATCH] D116190: Comment parsing: Don't recognize commands in single-line double quotation

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 22 14:26:14 PST 2021


aaronpuchert created this revision.
aaronpuchert added a reviewer: gribozavr2.
aaronpuchert requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This is consistent with the behavior of Doxygen, and allows users to
write strings with C escapes or document input/output formats containing
special characters (@ or \) without escaping them, which might be
confusing. For example, if a function wants to document its expected
input format as "user at host" it doesn't have to write user\@host instead,
which would look right in the documentation but confusing in the code.
Now users can just use double quotes (which they might do anyway).

This fixes a lot of false positives of -Wdocumentation-unknown-command,
but it could also fix issues with -Wdocumentation if the text triggers
an actual command.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116190

Files:
  clang/include/clang/AST/CommentLexer.h
  clang/lib/AST/CommentLexer.cpp
  clang/test/Sema/warn-documentation-unknown-command.cpp
  clang/test/Sema/warn-documentation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116190.395932.patch
Type: text/x-patch
Size: 3883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211222/3e6b17ba/attachment.bin>


More information about the cfe-commits mailing list