[PATCH] C++: add type checking for static local vector variable in template

2021-09-01 Thread wangpc via Gcc-patches
From: wangpc --- gcc/cp/pt.c| 8 +++- .../aarch64/sve/static-var-in-template.C | 18 ++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.target/aarch64/sve/static-var-in-template.C diff --git a

[PATCH] C++: add type checking for static local vector variable in template

2021-09-06 Thread wangpc via Gcc-patches
This patch adds type checking for static local vector variable in C++ template, both AArch64 SVE and RISCV RVV are of sizeless type and thay all have this issue. 2021-08-06 wangpc gcc/cp/ChangeLog * pt.c (tsubst_decl): Add type checking. gcc/testsuite/ChangeLog * g++.target/

[PATCH] C++: add type checking for static local vector variable in template

2021-09-16 Thread wangpc via Gcc-patches
This patch adds type checking for static local vector variable in C++ template, both AArch64 SVE and RISCV RVV are of sizeless type and they all have this issue. 2021-08-06 wangpc gcc/cp/ChangeLog * pt.c (tsubst_decl): Add type checking. gcc/testsuite/ChangeLog * g++.target/

[PATCH] C++: add type checking for static local vector variable in template

2021-09-16 Thread wangpc via Gcc-patches
This patch adds type checking for static local vector variable in C++ template, both AArch64 SVE and RISCV RVV are of sizeless type and they all have this issue. 2021-08-06 wangpc gcc/cp/ChangeLog * decl.c (cp_finish_decl): Add type checking. gcc/testsuite/ChangeLog * g++.ta

[PATCH v2] C++: add type checking for static local vector variable in template

2021-09-16 Thread wangpc via Gcc-patches
This patch adds type checking for static local vector variable in C++ template, both AArch64 SVE and RISCV RVV are of sizeless type and they all have this issue. 2021-08-06 wangpc gcc/cp/ChangeLog * decl.c (cp_finish_decl): Add type checking. gcc/testsuite/ChangeLog * g++.ta

[PATCH v2] C++: add type checking for static local vector variable in template

2021-09-17 Thread wangpc via Gcc-patches
This patch moves verify_type_context from start_decl_1 to cp_finish_decl and adds type checking for static local vector variable in C++ template. 2021-08-06 wangpc gcc/cp/ChangeLog * decl.c (start_decl_1): Remove verify_type_context. (cp_finish_decl): Add more type che

[PATCH] C++: add type checking for static local vector variable in template

2021-09-17 Thread wangpc via Gcc-patches
Thanks for your advice, I have misunderstood what you meant. I have sent a second version patch, please review whether it is OK. On 2021/9/16 23:19, Jason Merrill wrote: On 9/16/21 05:11, wangpc via Gcc-patches wrote: This patch adds type checking for static local vector variable in C

Re: [PATCH v2] C++: add type checking for static local vector variable in template

2021-09-17 Thread wangpc via Gcc-patches
I have tested this patch on AArch64 and RISCV by running testsuites, the diagnostic message seems to be right. While one thing that should be noted is that error message will be reported twice as below: static-template.cpp: In instantiation of 'void f1() [with int a = 2]': static-template.cpp

Re: [PATCH v2] C++: add type checking for static local vector variable in template

2021-09-17 Thread wangpc via Gcc-patches
OK I know, it's because the redundant code will check a declaration twice. On 2021/9/17 22:30, wangpc wrote: I have tested this patch on AArch64 and RISCV by running testsuites, the diagnostic message seems to be right. While one thing that should be noted is that error message will be repo

[PATCH v2] C++: add type checking for static local vector variable in template

2021-09-17 Thread wangpc via Gcc-patches
This patch moves verify_type_context from start_decl_1 to cp_finish_decl to do more type checking such as static local vector variable in C++ template. 2021-08-06 wangpc gcc/cp/ChangeLog * decl.c (start_decl_1): Move verify_type_context to ... (cp_finish_decl): ... to

[PATCH] RISC-V: Compute default ABI from -mcpu or -march

2022-06-06 Thread wangpc via Gcc-patches
If -mcpu or -march is specified and there is no -mabi, we will calculate default ABI from arch string provided by -march or defined in CPU info. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (compute_default_abi): Implementation to calculate -mabi from arch string.