Previously clang AST prints the following declaration:
int fun_var_unused() {
int x __attribute__((unused)) = 0;
return x;
}
and
int __declspec(thread) x = 0;
as:
int fun_var_unused() {
int x = 0 __attribute__((unused));
return x;
}
and
int x = __declspec(thread) 0;
which is rejected by C/C++ parser. This patch modifies the logic to
print old C attributes for variables as:
int __attribute__((unused)) x = 0;
and the __declspec case as:
int __declspec(thread) x = 0;
Fixes: https://github.com/llvm/llvm-project/issues/59973
Previous version: D141714.
Differential Revision:https://reviews.llvm.org/D141714
DeclPrinter::PrintConstructorInitializers did output non-written constructor initiaizers. In particular, implicit constructor initializers of base classes were output.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D156523
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 https://github.com/llvm/llvm-project/issues/62996
Initial commit had a failing test case on targets not supporting `__attribute__((alias))`. Added `-triple i386-linux-gnu` to the specific test case.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D156533
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 https://github.com/llvm/llvm-project/issues/62996
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D156533
DeclPrinter::PrintConstructorInitializers did not consider delegating initializers. As result, the output contained an "NULL TYPE" for delegating constructors.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D154186