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..8042d6e2e8 --- /dev/null +++ b/src/pending_changes/edg-28967-deep-pointer-qualification.txt @@ -0,0 +1,16 @@ +[GH #455] +GNU/Clang compatibility: unsafe multilevel pointer qualification conversions + +In GNU and Clang C++ modes, 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. The qualification +conversion changes for EDGcpfe/18553 are now also enabled for Clang 7.x and +later, and the version check for MSVC 19.14 and later has been corrected. +Conversions to arrays of unknown bound remain disabled for Clang versions +before 14. 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..953b441bfa 100644 --- a/src/types.c +++ b/src/types.c @@ -10989,16 +10989,17 @@ weird Microsoft-mode handling of the __unaligned and __restrict qualifiers). } /* if */ dest_type = pm_member_type(dest_type); source_type = pm_member_type(source_type); - } else if (!gpp_version_is(<80000) && !clang_mode && - !ms_version_is(>= 1914) && + } else if (!gpp_version_is(<80000) && !clang_version_is(<70000) && + !ms_version_is(<1914) && is_array(source_type) && is_array(dest_type)) { /* N4261 reworked qualification conversions to include arrays (thereby - resolving Core issue 330). GCC versions prior to 8.x, Clang, and - (some versions of) MSVC do not appear to implement that yet. - P0338R4 (in C++20) adjusted this further to allow conversions from - arrays with known bounds to arrays with unknown bounds. */ + resolving Core issue 330). Older emulated compilers do not + implement that. P0388R4 (in C++20) adjusted this further to allow + conversions from arrays with known bounds to arrays with unknown + bounds. */ if (!identical_array_type_level(source_type, dest_type) && - !(cpp20_mode && !has_unknown_specified_bound(dest_type) && + !(cpp20_mode && !clang_version_is(<140000) && + !has_unknown_specified_bound(dest_type) && dest_type->variant.array.variant.number_of_elements == 0)) { same = FALSE; break; @@ -11384,6 +11385,7 @@ conversion in C++/CLI because it drops gc-ness of an interior_ptr. #endif /* MICROSOFT_EXTENSIONS_ALLOWED */ + a_boolean impl_pointer_conversion( a_type_ptr source_type, a_boolean source_is_constant, @@ -11689,6 +11691,7 @@ 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 && same_type_with_added_qualifiers( source_type_pointed_to, dest_type_pointed_to, @@ -11700,7 +11703,9 @@ operators), 3.3.15 (?: operator), and 3.3.16.1 (simple assignment). "int **" -> "const int **". This is similar to the qualification conversion that is checked above, except that a few additional cases are accepted. These are cases that are not const-safe, - so a warning is issued in most modes. This is an extension. */ + so a warning is issued in most modes. This is an extension, + which is not provided in GNU and Clang modes since GCC and Clang + reject such conversions. */ okay = TRUE; std_conv->nontrivial_conversion = FALSE; std_conv->type_qualifiers_added = qualifiers_added; 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..53a6ae5078 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 @@ -177,14 +177,6 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -789,7 +781,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 +841,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..64a891164b 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 @@ -169,14 +169,6 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -751,7 +743,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 +823,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..398fee2abb 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 @@ -165,14 +165,6 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -743,7 +735,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 +815,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..9cb9d0b1f5 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 @@ -161,14 +161,6 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -739,7 +731,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 +811,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..8ffce6323f 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..e68430c27e 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..1b25820fe0 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..5660e16c34 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 @@ -177,14 +177,6 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -789,7 +781,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 +841,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..3a93a0776c 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 @@ -169,14 +169,6 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -751,7 +743,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 +823,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..c4fe9a8cdf 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 @@ -165,14 +165,6 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -743,7 +735,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 +815,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..dcf9301686 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 @@ -161,14 +161,6 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -739,7 +731,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 +811,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..521384a86f 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..63c0a388a3 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..1a35573ca2 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 @@ -161,22 +161,10 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -739,7 +727,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 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..7666fe8eaf 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 @@ -189,14 +189,6 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -829,7 +821,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 +854,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..ad43664240 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 @@ -181,14 +181,6 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -791,7 +783,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 +836,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..e590c81586 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 @@ -177,14 +177,6 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -783,7 +775,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 +828,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..891f31b0ab 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 @@ -173,14 +173,6 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -779,7 +771,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 +824,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..89075507de 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..26e6149f78 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..f4ca99f423 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..73fa938dd8 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 @@ -189,14 +189,6 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -829,7 +821,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 +854,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..f5ad90cab7 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 @@ -181,14 +181,6 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -791,7 +783,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 +836,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..8b7cf253d0 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 @@ -177,14 +177,6 @@ fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -783,7 +775,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 +828,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..21709e1d57 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 @@ -173,14 +173,6 @@ fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ @@ -779,7 +771,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 +824,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..7201a789bf 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=5 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..d9b73d922e 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=6 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..99b3622200 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 @@ -173,22 +173,10 @@ fe_only -DTEST_NUMBER=7 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers ^ detected during instantiation of class "cwg329::A [with T=int]" at line 453 -"Test_name.c", line 467: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q" (aka "const int *const (*)[3]") - q = p; // ok - ^ - -"Test_name.c", line 468: warning: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::Q2" (aka "const cwg330::Qinner *") - q2 = p; // ok - ^ - "Test_name.c", line 469: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::R" (aka "const int *const (*)[4]") r = p; ^ -"Test_name.c", line 471: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::S" (aka "const int *const (*)[]") - s = p; - ^ - "Test_name.c", line 473: error: a value of type "cwg330::P" (aka "int *(*)[3]") cannot be assigned to an entity of type "cwg330::T" (aka "const int *(*)[]") t = p; ^ @@ -779,7 +767,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 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..b2c2347149 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}} ^ @@ -15,7 +15,7 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers int const A::* const A::* pp2 = pp; ^ -"Test_name.c", line 35: warning: argument of type "int *(*)[1]" is incompatible with parameter of type "const int *(*)[1]" +"Test_name.c", line 35: error: argument of type "int *(*)[1]" is incompatible with parameter of type "const int *(*)[1]" aquals2a(pp2); // 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". +3 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-bounds-neg.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967-array-bounds-neg.rto/default.1.1.txt new file mode 100644 index 0000000000..640ed5ab45 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-bounds-neg.rto/default.1.1.txt @@ -0,0 +1,6 @@ +fe_only -DTEST_NUMBER=1 --c++20 --clang --clang_version=130000 Test_name.c +"Test_name.c", line 11: error: a value of type "P" (aka "int *(*)[3]") cannot be assigned to an entity of type "S" (aka "const int *const (*)[]") + s = p; + ^ + +1 error detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array-bounds-neg.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967-array-bounds-neg.rto/default.2.1.txt new file mode 100644 index 0000000000..b822f25474 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-bounds-neg.rto/default.2.1.txt @@ -0,0 +1,6 @@ +fe_only -DTEST_NUMBER=2 --c++17 --clang --clang_version=140000 Test_name.c +"Test_name.c", line 11: error: a value of type "P" (aka "int *(*)[3]") cannot be assigned to an entity of type "S" (aka "const int *const (*)[]") + s = p; + ^ + +1 error detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array-bounds.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.1.1.txt new file mode 100644 index 0000000000..b4518287a6 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.1.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=1 --c++20 --clang --clang_version=140000 Test_name.c diff --git a/tests/tests/regressions/.edg-28967-array-bounds.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.2.1.txt new file mode 100644 index 0000000000..db97dd90b3 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.2.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=2 --c++20 --clang --clang_version=180000 Test_name.c diff --git a/tests/tests/regressions/.edg-28967-array-bounds.rto/default.3.1.txt b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.3.1.txt new file mode 100644 index 0000000000..2ee94a5044 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-bounds.rto/default.3.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=3 --c++20 --strict Test_name.c diff --git a/tests/tests/regressions/.edg-28967-array-neg.rto/default.1.1.txt b/tests/tests/regressions/.edg-28967-array-neg.rto/default.1.1.txt new file mode 100644 index 0000000000..173674f3ba --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-neg.rto/default.1.1.txt @@ -0,0 +1,10 @@ +fe_only -DTEST_NUMBER=1 --c++20 --clang --clang_version=180000 Test_name.c +"Test_name.c", line 14: error: argument of type "A **" (aka "int (**)[3]") is incompatible with parameter of type "const A **" + take(p); + ^ + +"Test_name.c", line 15: error: argument of type "int *(*)[3]" is incompatible with parameter of type "const int *(*)[3]" + take2(q); + ^ + +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array-neg.rto/default.2.1.txt b/tests/tests/regressions/.edg-28967-array-neg.rto/default.2.1.txt new file mode 100644 index 0000000000..85c7a4f0e9 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-neg.rto/default.2.1.txt @@ -0,0 +1,10 @@ +fe_only -DTEST_NUMBER=2 --c++20 --g++ --gnu_version=130300 Test_name.c +"Test_name.c", line 14: error: argument of type "A **" (aka "int (**)[3]") is incompatible with parameter of type "const A **" + take(p); + ^ + +"Test_name.c", line 15: error: argument of type "int *(*)[3]" is incompatible with parameter of type "const int *(*)[3]" + take2(q); + ^ + +2 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array-neg.rto/default.3.1.txt b/tests/tests/regressions/.edg-28967-array-neg.rto/default.3.1.txt new file mode 100644 index 0000000000..f9f0786e85 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-neg.rto/default.3.1.txt @@ -0,0 +1,14 @@ +fe_only -DTEST_NUMBER=3 --c++20 --clang --clang_version=60000 Test_name.c +"Test_name.c", line 14: error: argument of type "A **" (aka "int (**)[3]") is incompatible with parameter of type "const A **" + take(p); + ^ + +"Test_name.c", line 15: error: argument of type "int *(*)[3]" is incompatible with parameter of type "const int *(*)[3]" + take2(q); + ^ + +"Test_name.c", line 18: error: argument of type "double *const (*)[3]" is incompatible with parameter of type "const double *const (*)[3]" + take3(r); + ^ + +3 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967-array-neg.rto/default.4.1.txt b/tests/tests/regressions/.edg-28967-array-neg.rto/default.4.1.txt new file mode 100644 index 0000000000..a743484dab --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array-neg.rto/default.4.1.txt @@ -0,0 +1,14 @@ +fe_only -DTEST_NUMBER=4 --c++20 --g++ --gnu_version=70500 Test_name.c +"Test_name.c", line 14: error: argument of type "A **" (aka "int (**)[3]") is incompatible with parameter of type "const A **" + take(p); + ^ + +"Test_name.c", line 15: error: argument of type "int *(*)[3]" is incompatible with parameter of type "const int *(*)[3]" + take2(q); + ^ + +"Test_name.c", line 18: error: argument of type "double *const (*)[3]" is incompatible with parameter of type "const double *const (*)[3]" + take3(r); + ^ + +3 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..327e937c66 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.1.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=1 --c++20 --clang --clang_version=180000 Test_name.c 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..5d3eddf55e --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.2.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=2 --c++20 --clang --clang_version=70000 Test_name.c 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..fd593086e5 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.3.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=3 --c++20 --g++ --gnu_version=130300 Test_name.c diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.4.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.4.1.txt new file mode 100644 index 0000000000..75a8958cba --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.4.1.txt @@ -0,0 +1,5 @@ +fe_only -DTEST_NUMBER=4 --c++20 --microsoft --microsoft_version=1910 Test_name.c +"Test_name.c", line 13: warning: argument of type "double *const (*)[3]" is incompatible with parameter of type "const double *const (*)[3]" + take(p); + ^ + diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.5.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.5.1.txt new file mode 100644 index 0000000000..8760d660fd --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.5.1.txt @@ -0,0 +1,5 @@ +fe_only -DTEST_NUMBER=5 --c++20 --microsoft --microsoft_version=1913 Test_name.c +"Test_name.c", line 13: warning: argument of type "double *const (*)[3]" is incompatible with parameter of type "const double *const (*)[3]" + take(p); + ^ + diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.6.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.6.1.txt new file mode 100644 index 0000000000..385e542b18 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.6.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=6 --c++20 --microsoft --microsoft_version=1914 Test_name.c diff --git a/tests/tests/regressions/.edg-28967-array.rto/default.7.1.txt b/tests/tests/regressions/.edg-28967-array.rto/default.7.1.txt new file mode 100644 index 0000000000..06182b332f --- /dev/null +++ b/tests/tests/regressions/.edg-28967-array.rto/default.7.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=7 --c++20 --microsoft --microsoft_version=1940 Test_name.c 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..5141f097e3 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-positive.rto/default.1.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=1 --c++20 --g++ --gnu_version=130300 Test_name.c 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..db97dd90b3 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-positive.rto/default.2.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=2 --c++20 --clang --clang_version=180000 Test_name.c diff --git a/tests/tests/regressions/.edg-28967-positive.rto/default.3.1.txt b/tests/tests/regressions/.edg-28967-positive.rto/default.3.1.txt new file mode 100644 index 0000000000..2ee94a5044 --- /dev/null +++ b/tests/tests/regressions/.edg-28967-positive.rto/default.3.1.txt @@ -0,0 +1 @@ +fe_only -DTEST_NUMBER=3 --c++20 --strict Test_name.c 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..40cd84470a --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.1.1.txt @@ -0,0 +1,18 @@ +fe_only -DTEST_NUMBER=1 --c++20 --g++ --gnu_version=130300 Test_name.c +"Test_name.c", line 13: error: argument of type "char **" is incompatible with parameter of type "const char **" + take(p); + ^ + +"Test_name.c", line 14: 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 16: error: argument of type "char ***" is incompatible with parameter of type "const char ***" + take3(q); + ^ + +"Test_name.c", line 17: error: static_cast cannot cast away const or other type qualifiers + take(static_cast(p)); + ^ + +4 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..61541aca63 --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.2.1.txt @@ -0,0 +1,18 @@ +fe_only -DTEST_NUMBER=2 --c++20 --g++ --gnu_version=150200 Test_name.c +"Test_name.c", line 13: error: argument of type "char **" is incompatible with parameter of type "const char **" + take(p); + ^ + +"Test_name.c", line 14: 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 16: error: argument of type "char ***" is incompatible with parameter of type "const char ***" + take3(q); + ^ + +"Test_name.c", line 17: error: static_cast cannot cast away const or other type qualifiers + take(static_cast(p)); + ^ + +4 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..d0683b4bef --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.3.1.txt @@ -0,0 +1,18 @@ +fe_only -DTEST_NUMBER=3 --c++20 --clang --clang_version=180000 Test_name.c +"Test_name.c", line 13: error: argument of type "char **" is incompatible with parameter of type "const char **" + take(p); + ^ + +"Test_name.c", line 14: 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 16: error: argument of type "char ***" is incompatible with parameter of type "const char ***" + take3(q); + ^ + +"Test_name.c", line 17: error: static_cast cannot cast away const or other type qualifiers + take(static_cast(p)); + ^ + +4 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/.edg-28967.rto/default.4.1.txt b/tests/tests/regressions/.edg-28967.rto/default.4.1.txt new file mode 100644 index 0000000000..77dff21db7 --- /dev/null +++ b/tests/tests/regressions/.edg-28967.rto/default.4.1.txt @@ -0,0 +1,18 @@ +fe_only -DTEST_NUMBER=4 --c++20 --strict Test_name.c +"Test_name.c", line 13: error: argument of type "char **" is incompatible with parameter of type "const char **" + take(p); + ^ + +"Test_name.c", line 14: 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 16: error: argument of type "char ***" is incompatible with parameter of type "const char ***" + take3(q); + ^ + +"Test_name.c", line 17: error: static_cast cannot cast away const or other type qualifiers + take(static_cast(p)); + ^ + +4 errors detected in the compilation of "Test_name.c". diff --git a/tests/tests/regressions/edg-28967-array-bounds-neg.sft.cpp b/tests/tests/regressions/edg-28967-array-bounds-neg.sft.cpp new file mode 100644 index 0000000000..6410123d41 --- /dev/null +++ b/tests/tests/regressions/edg-28967-array-bounds-neg.sft.cpp @@ -0,0 +1,13 @@ +//type:fn +//options:--c++20 --clang --clang_version=130000:--c++17 --clang --clang_version=140000 +//remark:Qualification conversion to an unknown bound before its support + +using P = int *(*)[3]; +using S = const int *const (*)[]; + +void take(S); + +void reject(P p, S s) { + s = p; + take(s); +} diff --git a/tests/tests/regressions/edg-28967-array-bounds.sft.cpp b/tests/tests/regressions/edg-28967-array-bounds.sft.cpp new file mode 100644 index 0000000000..18f661b166 --- /dev/null +++ b/tests/tests/regressions/edg-28967-array-bounds.sft.cpp @@ -0,0 +1,14 @@ +//type:fp +//options_all:--c++20 +//options:--clang --clang_version=140000:--clang --clang_version=180000:--strict +//remark:Qualification conversion to an array of unknown bound + +using P = int *(*)[3]; +using S = const int *const (*)[]; + +void take(S); + +void allow(P p, S s) { + s = p; + take(s); +} diff --git a/tests/tests/regressions/edg-28967-array-neg.sft.cpp b/tests/tests/regressions/edg-28967-array-neg.sft.cpp new file mode 100644 index 0000000000..2fac89e956 --- /dev/null +++ b/tests/tests/regressions/edg-28967-array-neg.sft.cpp @@ -0,0 +1,19 @@ +//type:fn +//options_all:--c++20 +//options:--clang --clang_version=180000:--g++ --gnu_version=130300:--clang --clang_version=60000:--g++ --gnu_version=70500 +//remark:Unsafe qualification conversions through array levels + +using A = int[3]; + +void take(const A **); +void take2(const int *(*)[3]); +void take3(const double *const (*)[3]); + +void reject(A **p, int *(*q)[3], double *const (*r)[3]) { + // Not const-safe: rejected by GCC and Clang. + take(p); + take2(q); + // Const-safe, and accepted by Clang 7.0 and later and by GCC 10 and later. + // Earlier versions do not look through the array level, so they reject it. + take3(r); +} 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..f8891bec3b --- /dev/null +++ b/tests/tests/regressions/edg-28967-array.sft.cpp @@ -0,0 +1,15 @@ +//type:fp +//options_all:--c++20 +//options:--clang --clang_version=180000:--clang --clang_version=70000:--g++ --gnu_version=130300:--microsoft --microsoft_version=1910:--microsoft --microsoft_version=1913:--microsoft --microsoft_version=1914:--microsoft --microsoft_version=1940 +//remark:Const-safe qualification conversions through array levels + +// Clang 7.0 and later, GCC 10 and later, and MSVC 19.14 and later look through +// array levels when checking a qualification conversion (N4261, Core issue 330). + +void take(const double *const (*)[3]); +void take2(char *const (*)[2]); + +void allow(double *const (*p)[3], char *(*q)[2]) { + take(p); + take2(q); +} 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..5fa307aeda --- /dev/null +++ b/tests/tests/regressions/edg-28967-positive.sft.cpp @@ -0,0 +1,14 @@ +//type:fp +//options_all:--c++20 +//options:--g++ --gnu_version=130300:--clang --clang_version=180000:--strict +//remark:Const-safe multilevel pointer qualification conversions + +void take(char *const *); +void take_c(const char *const *); +void take3(const char *const *const *); + +void allow(char **p, char ***q) { + take(p); + take_c(p); + take3(q); +} diff --git a/tests/tests/regressions/edg-28967.sft.cpp b/tests/tests/regressions/edg-28967.sft.cpp new file mode 100644 index 0000000000..b5de2256c0 --- /dev/null +++ b/tests/tests/regressions/edg-28967.sft.cpp @@ -0,0 +1,18 @@ +//type:fn +//options_all:--c++20 +//options:--g++ --gnu_version=130300:--g++ --gnu_version=150200:--clang --clang_version=180000:--strict +//remark:Unsafe multilevel pointer qualification conversions + +// Adding const below the first level without adding it at every level in +// between is not const-safe; GCC and Clang reject these conversions. + +void take(const char **); +void take3(const char ***); + +void reject(char **p, char ***q) { + take(p); + const char **bad = p; + take(bad); + take3(q); + take(static_cast(p)); +}