aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
authorGiuliano Belinassi <gbelinassi@suse.de>2023-09-07 08:34:37 -0700
committererichkeane <ekeane@nvidia.com>2023-09-07 13:35:50 -0700
commit46f3ade5083b8bfce55c78a21086a487eaac6f99 (patch)
tree9d8e7d694a9143f3602ce6e076c87fe017aae630 /clang/unittests/Frontend/CompilerInvocationTest.cpp
parent04224d1ae72388b9b217555049f4219737ee26c6 (diff)
downloadllvm-46f3ade5083b8bfce55c78a21086a487eaac6f99.zip
llvm-46f3ade5083b8bfce55c78a21086a487eaac6f99.tar.gz
llvm-46f3ade5083b8bfce55c78a21086a487eaac6f99.tar.bz2
Fix ast print of variables with attributes
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
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
0 files changed, 0 insertions, 0 deletions