diff --git a/src/pending_changes/edg-28967-deep-pointer-qualification.txt b/src/pending_changes/edg-28967-deep-pointer-qualification.txt new file mode 100644 index 0000000000..5ba4ebcbd0 --- /dev/null +++ b/src/pending_changes/edg-28967-deep-pointer-qualification.txt @@ -0,0 +1,15 @@ +[GH #455] +GNU C++ mode: unsafe qualification conversions of multilevel pointers + +In GNU C++ mode (including Clang mode), an implicit conversion between +multilevel pointer types that adds const below the first level without adding +it at every intermediate level (e.g., "char **" to "const char **") was +accepted with a warning. Such a conversion is not const-safe and is not a +valid qualification conversion; GCC and Clang reject it. It is now an error. +Conversions through array levels that the qualification conversion check does +not handle in the emulated mode are still accepted with a warning. For +example, with --g++: + + void f(char **p) { + const char **q = p; // Now an error. + } diff --git a/src/types.c b/src/types.c index 3e8a3aed1b..7f2c99bb80 100644 --- a/src/types.c +++ b/src/types.c @@ -11384,6 +11384,46 @@ conversion in C++/CLI because it drops gc-ness of an interior_ptr. #endif /* MICROSOFT_EXTENSIONS_ALLOWED */ + +static a_boolean qualification_check_skips_arrays(a_type_ptr source_type, + a_type_ptr dest_type) +/* +Return TRUE if source_type or dest_type (the types pointed to by the two sides +of a pointer conversion) has an array type below some number of pointer and +pointer-to-member levels, and qualification_conversion_possible does not look +through array levels in the current mode (GNU C++ versions before 8.x and +Clang; see qualification_conversion_possible_full). In that case, a failed +qualification conversion check does not establish that a conversion that +adds qualifiers is unsafe. +*/ +{ + a_boolean result = FALSE; + + if (gpp_version_is(<80000) || clang_mode) { + a_type_ptr tp; + int side; + + for (side = 0; side < 2 && !result; side++) { + tp = side == 0 ? source_type : dest_type; + for (;;) { + tp = skip_typerefs(tp); + if (is_array(tp)) { + result = TRUE; + break; + } else if (is_pointer_or_handle(tp)) { + tp = type_pointed_to(tp); + } else if (is_ptr_to_member(tp)) { + tp = pm_member_type(tp); + } else { + break; + } /* if */ + } /* for */ + } /* for */ + } /* if */ + return result; +} /* qualification_check_skips_arrays */ + + a_boolean impl_pointer_conversion( a_type_ptr source_type, a_boolean source_is_constant, @@ -11689,6 +11729,9 @@ operators), 3.3.15 (?: operator), and 3.3.16.1 (simple assignment). std_conv->warning_suggested = warning_suggested; qualifiers_checked = TRUE; } else if ((!suppress_extensions || any_cfront_mode()) && + (!gpp_mode || + qualification_check_skips_arrays(source_type_pointed_to, + dest_type_pointed_to)) && same_type_with_added_qualifiers( source_type_pointed_to, dest_type_pointed_to, diff --git a/tests/tests/imported/clang/cpp/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/.p6.rto/default.1.1.txt b/tests/tests/imported/clang/cpp/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/.p6.rto/default.1.1.txt index d721f9cdaa..04444dc463 100644 --- a/tests/tests/imported/clang/cpp/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/.p6.rto/default.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/.p6.rto/default.1.1.txt @@ -55,7 +55,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const auto **fail2(p); // expected-error {{variable 'fail2' with type 'const auto **' has incompatible initializer of type 'int **'}} ^ -"Test_name.c", line 60: warning: a value of type "int **" cannot be used to initialize an entity of type "const int **" +"Test_name.c", line 60: error: a value of type "int **" cannot be used to initialize an entity of type "const int **" const auto **fail2(p); // expected-error {{variable 'fail2' with type 'const auto **' has incompatible initializer of type 'int **'}} ^ @@ -63,10 +63,6 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const auto **fail2(p); // expected-error {{variable 'fail2' with type 'const auto **' has incompatible initializer of type 'int **'}} ^ -"Test_name.c", line 60: warning: variable "fail2" was declared but never referenced - const auto **fail2(p); // expected-error {{variable 'fail2' with type 'const auto **' has incompatible initializer of type 'int **'}} - ^ - "Test_name.c", line 70: warning: "auto" as a type specifier is nonstandard in this mode auto p1 = &S::f; ^ @@ -123,4 +119,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int (*funcptr2)(int) = funcptr; ^ -4 errors detected in the compilation of "Test_name.c". +5 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.1.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.1.1.txt index 343dc2cea2..433fabe95d 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.1.1.txt @@ -27,11 +27,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -59,4 +55,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -10 errors detected in the compilation of "Test_name.c". +11 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.2.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.2.1.txt index 0c37eed9f9..07d77f4eb0 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.2.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.2.1.txt @@ -37,11 +37,7 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -92,4 +88,4 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -14 errors detected in the compilation of "Test_name.c". +15 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.3.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.3.1.txt index 55e981ef91..34349eba9b 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.3.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.3.1.txt @@ -37,11 +37,7 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -96,4 +92,4 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -15 errors detected in the compilation of "Test_name.c". +16 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.4.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.4.1.txt index 16d4bb9104..208d482f80 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.4.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.4.1.txt @@ -27,11 +27,7 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -102,4 +98,4 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -17 errors detected in the compilation of "Test_name.c". +18 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.5.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.5.1.txt index de40e9508e..f9cdbb313f 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.5.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.5.1.txt @@ -27,11 +27,7 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -152,4 +148,4 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -20 errors detected in the compilation of "Test_name.c". +21 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.6.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.6.1.txt index 0b462c00d7..4e716fd132 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.6.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.6.1.txt @@ -27,11 +27,7 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -152,4 +148,4 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -20 errors detected in the compilation of "Test_name.c". +21 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.7.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.7.1.txt index e4038ccd4d..ae66cdd2c6 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.7.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg23xx.rto/default.7.1.txt @@ -27,11 +27,7 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int *const *const &f2() { return p; } ^ -"Test_name.c", line 261: warning: return value type does not match the function type - const int **const &f4() { return p; } - ^ - -"Test_name.c", line 261: warning: returning reference to local temporary +"Test_name.c", line 261: error: return value type does not match the function type const int **const &f4() { return p; } ^ @@ -152,4 +148,4 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A a; ^ -20 errors detected in the compilation of "Test_name.c". +21 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.1.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.1.1.txt index ce6a7425ef..637d438ff6 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.1.1.txt @@ -789,7 +789,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -849,4 +849,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A b(a); ^ -154 errors detected in the compilation of "Test_name.c". +155 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.2.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.2.1.txt index 1e557faba9..d91355724a 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.2.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.2.1.txt @@ -751,7 +751,7 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -831,4 +831,4 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.3.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.3.1.txt index e50db5bec4..b2c68be964 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.3.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.3.1.txt @@ -743,7 +743,7 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -823,4 +823,4 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.4.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.4.1.txt index 4aa6d9282a..1ea5640e7a 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.4.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.4.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.5.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.5.1.txt index 6b28231b91..4d00a4ead9 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.5.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.5.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -156 errors detected in the compilation of "Test_name.c". +157 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.6.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.6.1.txt index 3183377c46..415b60722a 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.6.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.6.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -156 errors detected in the compilation of "Test_name.c". +157 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.7.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.7.1.txt index b7f710a40a..be2dd73092 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.7.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/default.7.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -156 errors detected in the compilation of "Test_name.c". +157 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.1.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.1.1.txt index 984130d641..5de312c754 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.1.1.txt @@ -789,7 +789,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -849,4 +849,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A b(a); ^ -153 errors detected in the compilation of "Test_name.c". +154 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.2.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.2.1.txt index 26f678bf43..a150eb3395 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.2.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.2.1.txt @@ -751,7 +751,7 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -831,4 +831,4 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -154 errors detected in the compilation of "Test_name.c". +155 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.3.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.3.1.txt index f129351221..0a51d144a2 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.3.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.3.1.txt @@ -743,7 +743,7 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -823,4 +823,4 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -154 errors detected in the compilation of "Test_name.c". +155 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.4.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.4.1.txt index 4e6a0209c3..5a1a66fefe 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.4.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.4.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -154 errors detected in the compilation of "Test_name.c". +155 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.5.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.5.1.txt index 33db6f813f..44ce92c992 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.5.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.5.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.6.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.6.1.txt index 61c6f0af8a..ec970971e6 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.6.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.6.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.7.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.7.1.txt index 951d0c8e04..2e8f925e21 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.7.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32.7.1.txt @@ -739,7 +739,7 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -819,4 +819,4 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -155 errors detected in the compilation of "Test_name.c". +156 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.1.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.1.1.txt index 74e9a1cf77..fd7219c13c 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.1.1.txt @@ -829,7 +829,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -862,4 +862,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A b(a); ^ -156 errors detected in the compilation of "Test_name.c". +157 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.2.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.2.1.txt index e7f34b56b3..b236f2a63f 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.2.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.2.1.txt @@ -791,7 +791,7 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -844,4 +844,4 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -157 errors detected in the compilation of "Test_name.c". +158 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.3.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.3.1.txt index a521838ced..b22195fda3 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.3.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.3.1.txt @@ -783,7 +783,7 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -836,4 +836,4 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -157 errors detected in the compilation of "Test_name.c". +158 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.4.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.4.1.txt index 72aeb2aa41..2cdc60fcd2 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.4.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.4.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -157 errors detected in the compilation of "Test_name.c". +158 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.5.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.5.1.txt index 3314f1ed0e..c5d9099223 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.5.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.5.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.6.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.6.1.txt index 1e49cb3b2e..88e13311c1 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.6.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.6.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.7.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.7.1.txt index 3d0782371d..d120f44b3e 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.7.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_32_cp.7.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.1.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.1.1.txt index 445c26b168..3fa5b62e03 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.1.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.1.1.txt @@ -829,7 +829,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -862,4 +862,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers const A b(a); ^ -157 errors detected in the compilation of "Test_name.c". +158 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.2.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.2.1.txt index f5f8ca2db9..bada2d174a 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.2.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.2.1.txt @@ -791,7 +791,7 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -844,4 +844,4 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.3.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.3.1.txt index 34092e6098..df21347457 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.3.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.3.1.txt @@ -783,7 +783,7 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -836,4 +836,4 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.4.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.4.1.txt index 03b27e8edc..627936ff72 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.4.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.4.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -158 errors detected in the compilation of "Test_name.c". +159 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.5.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.5.1.txt index 4112518296..99aea06f6f 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.5.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.5.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -159 errors detected in the compilation of "Test_name.c". +160 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.6.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.6.1.txt index 59b1ed38c4..47c7deab2e 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.6.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.6.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -159 errors detected in the compilation of "Test_name.c". +160 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.7.1.txt b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.7.1.txt index 992cb9c1dd..e5e84c5f91 100644 --- a/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.7.1.txt +++ b/tests/tests/imported/clang/cpp/CXX/drs/.cwg3xx.rto/edg_x86_64_cp.7.1.txt @@ -779,7 +779,7 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of "void cwg345::f(T) [with T=cwg345::A]" at line 753 -"Test_name.c", line 787: warning: return value type does not match the function type +"Test_name.c", line 787: error: return value type does not match the function type return p; ^ detected during instantiation of "cwg349::A::operator T ***() [with T=const int]" at line 796 @@ -832,4 +832,4 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers extern WithoutLinkage5 withoutLinkage5; ^ -159 errors detected in the compilation of "Test_name.c". +160 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/clang/cpp/SemaCXX/.qualification-conversion.rto/default.1.1.txt b/tests/tests/imported/clang/cpp/SemaCXX/.qualification-conversion.rto/default.1.1.txt index 78cdde81c2..dffcbe011b 100644 --- a/tests/tests/imported/clang/cpp/SemaCXX/.qualification-conversion.rto/default.1.1.txt +++ b/tests/tests/imported/clang/cpp/SemaCXX/.qualification-conversion.rto/default.1.1.txt @@ -1,5 +1,5 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 Test_name.c -"Test_name.c", line 12: warning: argument of type "int ***" is incompatible with parameter of type "const int **const *" +"Test_name.c", line 12: error: argument of type "int ***" is incompatible with parameter of type "const int **const *" quals3(ppp); // expected-error {{no matching}} ^ @@ -23,4 +23,4 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int const (*p2)[1] = p; ^ -1 error detected in the compilation of "Test_name.c". +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/imported/gnu/cpp/conversion/.qual1.rto/default.1.1.txt b/tests/tests/imported/gnu/cpp/conversion/.qual1.rto/default.1.1.txt index 308c3806e3..78183ce317 100644 --- a/tests/tests/imported/gnu/cpp/conversion/.qual1.rto/default.1.1.txt +++ b/tests/tests/imported/gnu/cpp/conversion/.qual1.rto/default.1.1.txt @@ -1,5 +1,5 @@ fe_only -DTEST_NUMBER=1 --gnu_version=999999 -tused -e 200 --no_wrap --no_wrap_diagnostics Test_name.c -"Test_name.c", line 11: warning: a value of type "int *(*)[4]" cannot be used to initialize an entity of type "const int *(*)[4]" +"Test_name.c", line 11: error: a value of type "int *(*)[4]" cannot be used to initialize an entity of type "const int *(*)[4]" const int *(*ap2)[4] = &a; // { dg-error "cannot convert" } ^ @@ -23,7 +23,7 @@ fe_only -DTEST_NUMBER=1 --gnu_version=999999 -tused -e 200 --no_wrap --no_wrap_d int *(*const bp8)[4] = &b; // { dg-error "cannot convert" } ^ -"Test_name.c", line 31: warning: a value of type "int *(*)[3]" cannot be used to initialize an entity of type "const int *(*)[3]" +"Test_name.c", line 31: error: a value of type "int *(*)[3]" cannot be used to initialize an entity of type "const int *(*)[3]" int const *(*cp2)[3] = c; // { dg-error "cannot convert" } ^ @@ -67,4 +67,4 @@ fe_only -DTEST_NUMBER=1 --gnu_version=999999 -tused -e 200 --no_wrap --no_wrap_d int const *const (*const cp3)[3] = c; ^ -5 errors detected in the compilation of "Test_name.c". +7 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.1.1.txt new file mode 100644 index 0000000000..aa99644358 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.1.1.txt @@ -0,0 +1,13 @@ +fe_only -DTEST_NUMBER=1 --c++20 --clang --clang_version=180000 Test_name.c +"Test_name.c", line 7: warning: a value of type "double *const (*)[3]" cannot be used to initialize an entity of type "const double *const (*)[3]" + const double *const (*a)[3] = p; + ^ + +"Test_name.c", line 7: warning: variable "a" was set but never used + const double *const (*a)[3] = p; + ^ + +"Test_name.c", line 8: warning: variable "b" was set but never used + char *const (*b)[2] = q; + ^ + diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.2.1.txt new file mode 100644 index 0000000000..fae591b492 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.2.1.txt @@ -0,0 +1,13 @@ +fe_only -DTEST_NUMBER=2 --c++20 --g++ --gnu_version=70500 Test_name.c +"Test_name.c", line 7: warning: a value of type "double *const (*)[3]" cannot be used to initialize an entity of type "const double *const (*)[3]" + const double *const (*a)[3] = p; + ^ + +"Test_name.c", line 7: warning: variable "a" was set but never used + const double *const (*a)[3] = p; + ^ + +"Test_name.c", line 8: warning: variable "b" was set but never used + char *const (*b)[2] = q; + ^ + diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.3.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.3.1.txt new file mode 100644 index 0000000000..4a7b95532e --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.3.1.txt @@ -0,0 +1,9 @@ +fe_only -DTEST_NUMBER=3 --c++20 --g++ --gnu_version=130300 Test_name.c +"Test_name.c", line 7: warning: variable "a" was set but never used + const double *const (*a)[3] = p; + ^ + +"Test_name.c", line 8: warning: variable "b" was set but never used + char *const (*b)[2] = q; + ^ + diff --git a/tests/tests/regressions/.edg-28967-positive.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967-positive.rto/default.1.1.txt new file mode 100644 index 0000000000..8a2dafb4be --- /dev/null +++ b/tests/tests/regressions/.edg-28967-positive.rto/default.1.1.txt @@ -0,0 +1,13 @@ +fe_only -DTEST_NUMBER=1 --c++20 --g++ --gnu_version=130300 Test_name.c +"Test_name.c", line 5: warning: variable "a" was set but never used + char *const *a = p; + ^ + +"Test_name.c", line 6: warning: variable "b" was set but never used + const char *const *b = p; + ^ + +"Test_name.c", line 7: warning: variable "c" was set but never used + const char *const *const *c = q; + ^ + diff --git a/tests/tests/regressions/.edg-28967-positive.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967-positive.rto/default.2.1.txt new file mode 100644 index 0000000000..9707f137e0 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-positive.rto/default.2.1.txt @@ -0,0 +1,13 @@ +fe_only -DTEST_NUMBER=2 --c++20 --strict Test_name.c +"Test_name.c", line 5: warning: variable "a" was set but never used + char *const *a = p; + ^ + +"Test_name.c", line 6: warning: variable "b" was set but never used + const char *const *b = p; + ^ + +"Test_name.c", line 7: warning: variable "c" was set but never used + const char *const *const *c = q; + ^ + diff --git a/tests/tests/regressions/.edg-28967.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967.rto/default.1.1.txt new file mode 100644 index 0000000000..6d57326a8d --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.1.1.txt @@ -0,0 +1,10 @@ +fe_only -DTEST_NUMBER=1 --c++20 --g++ --gnu_version=130300 Test_name.c +"Test_name.c", line 5: error: a value of type "char **" cannot be used to initialize an entity of type "const char **" + const char **bad = p; + ^ + +"Test_name.c", line 6: error: a value of type "char ***" cannot be used to initialize an entity of type "const char ***" + const char ***also_bad = q; + ^ + +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967.rto/default.2.1.txt new file mode 100644 index 0000000000..83651bbda0 --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.2.1.txt @@ -0,0 +1,10 @@ +fe_only -DTEST_NUMBER=2 --c++20 --g++ --gnu_version=150200 Test_name.c +"Test_name.c", line 5: error: a value of type "char **" cannot be used to initialize an entity of type "const char **" + const char **bad = p; + ^ + +"Test_name.c", line 6: error: a value of type "char ***" cannot be used to initialize an entity of type "const char ***" + const char ***also_bad = q; + ^ + +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967.rto/default.3.1.txt b/tests/tests/regressions/.edg-28967.rto/default.3.1.txt new file mode 100644 index 0000000000..36b62d5941 --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.3.1.txt @@ -0,0 +1,10 @@ +fe_only -DTEST_NUMBER=3 --c++20 --strict Test_name.c +"Test_name.c", line 5: error: a value of type "char **" cannot be used to initialize an entity of type "const char **" + const char **bad = p; + ^ + +"Test_name.c", line 6: error: a value of type "char ***" cannot be used to initialize an entity of type "const char ***" + const char ***also_bad = q; + ^ + +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/edg-28967-array.sft.cpp b/tests/tests/regressions/edg-28967-array.sft.cpp new file mode 100644 index 0000000000..5f8e4736ae --- /dev/null +++ b/tests/tests/regressions/edg-28967-array.sft.cpp @@ -0,0 +1,10 @@ +//type:fp +//options_all:--c++20 +//options:--clang --clang_version=180000:--g++ --gnu_version=70500:--g++ --gnu_version=130300 +// Const-safe qualification conversions through an array level remain valid +// in modes whose qualification conversion check does not traverse arrays. +void allow(double *const (*p)[3], char *(*q)[2]) { + const double *const (*a)[3] = p; + char *const (*b)[2] = q; + (void)a; (void)b; +} diff --git a/tests/tests/regressions/edg-28967-positive.sft.cpp b/tests/tests/regressions/edg-28967-positive.sft.cpp new file mode 100644 index 0000000000..1b29beb7ff --- /dev/null +++ b/tests/tests/regressions/edg-28967-positive.sft.cpp @@ -0,0 +1,9 @@ +//type:fp +//options_all:--c++20 +//options:--g++ --gnu_version=130300:--strict +void allow(char **p, char ***q) { + char *const *a = p; + const char *const *b = p; + const char *const *const *c = q; + (void)a; (void)b; (void)c; +} diff --git a/tests/tests/regressions/edg-28967.sft.cpp b/tests/tests/regressions/edg-28967.sft.cpp new file mode 100644 index 0000000000..a0b2c939c2 --- /dev/null +++ b/tests/tests/regressions/edg-28967.sft.cpp @@ -0,0 +1,9 @@ +//type:fn +//options_all:--c++20 +//options:--g++ --gnu_version=130300:--g++ --gnu_version=150200:--strict +void reject(char **p, char ***q) { + const char **bad = p; + const char ***also_bad = q; + (void)bad; + (void)also_bad; +}