diff options
author | Ken Matsui <kmatsui@gcc.gnu.org> | 2024-05-12 23:43:55 -0700 |
---|---|---|
committer | Ken Matsui <kmatsui@gcc.gnu.org> | 2024-05-13 10:18:46 -0700 |
commit | 30ff6c55ba0f2262cf292c90d7b9d771005305f0 (patch) | |
tree | 73450cf24d238297363ec627084dad92d0830b5e /gcc | |
parent | 44e7855e4e817a7f5a1e332cd95e780e57052dba (diff) | |
download | gcc-30ff6c55ba0f2262cf292c90d7b9d771005305f0.zip gcc-30ff6c55ba0f2262cf292c90d7b9d771005305f0.tar.gz gcc-30ff6c55ba0f2262cf292c90d7b9d771005305f0.tar.bz2 |
c++: Avoid using __array_rank as a variable name [PR115061]
This patch fixes a compilation error when building GCC using Clang.
Since __array_rank is used as a built-in trait name, use rank instead.
PR c++/115061
gcc/cp/ChangeLog:
* semantics.cc (finish_trait_expr): Use rank instead of
__array_rank.
Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/semantics.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 43b175f..df62e2d 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -12914,10 +12914,10 @@ finish_trait_expr (location_t loc, cp_trait_kind kind, tree type1, tree type2) tree val; if (kind == CPTK_RANK) { - size_t __array_rank = 0; + size_t rank = 0; for (; TREE_CODE (type1) == ARRAY_TYPE; type1 = TREE_TYPE (type1)) - ++__array_rank; - val = build_int_cst (size_type_node, __array_rank); + ++rank; + val = build_int_cst (size_type_node, rank); } else val = (trait_expr_value (kind, type1, type2) |