-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
ast-print generates empty parameter for attributes with optional string parameter #62996
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
EugeneZelenko
added
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
and removed
new issue
labels
May 30, 2023
@llvm/issue-subscribers-clang-frontend |
any plan to fix this? |
Not from my side as I am lacking experience how Attrs.inc is generated... |
razmser
pushed a commit
to razmser/llvm-project
that referenced
this issue
Sep 8, 2023
…hat are definitions without having a body DeclPrinter used FunctionDecl::isThisDeclarationADefinition to decide if the decl requires a semicolon at the end. However, there are several methods without body (that require a semicolon) that are definitions. Fixes llvm#62996 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D156533
seems your commit doesnt fix this issue problem? @strimo378 |
@yangdiangzb Hmm, yes that is correct. it seems I used the wrong link for the commit. Thanks for the information. |
Sorry about this. My private fork accidentally closed this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
the AST printer (
-Xclang -ast-print
) always generates an empty parameter for attributes with optional string parameters.The following code (see https://godbolt.org/z/v69YW7rsb)
is generates as
For the attributes of the function
a
andb1
an empty parameter("")
is added to the output code. In principle, the code is correct for Clang. It is only problematic that forwarn_unused_result
the optional parameter is not supported by GCC and the code becomes incompatible.The Clang source code to output an attributes is within the
*Attr::printPretty
functions within the TableGen'erated fileAttrs.inc
.The text was updated successfully, but these errors were encountered: