This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb12aea6659e1: [Clang] Implement CWG2654: Un-deprecation of compound volatile assignments (authored by cor3ntin). Herald added subscribers: kadircet, arphaman. Herald added a project: clang-tools-extra.
Changed prior to commit: https://reviews.llvm.org/D138918?vs=478562&id=478610#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138918/new/ https://reviews.llvm.org/D138918 Files: clang-tools-extra/clangd/Diagnostics.cpp clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaExpr.cpp clang/test/CXX/drs/dr26xx.cpp clang/test/SemaCXX/deprecated.cpp clang/www/cxx_dr_status.html
Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -15732,7 +15732,7 @@ <td><a href="https://wg21.link/cwg2654">2654</a></td> <td>DR</td> <td>Un-deprecation of compound volatile assignments</td> - <td class="none" align="center">Unknown</td> + <td class="unreleased" align="center">Clang 16</td> </tr></table> </div> Index: clang/test/SemaCXX/deprecated.cpp =================================================================== --- clang/test/SemaCXX/deprecated.cpp +++ clang/test/SemaCXX/deprecated.cpp @@ -186,10 +186,10 @@ --n; // cxx20-warning {{decrement of object of volatile-qualified type 'volatile int' is deprecated}} n++; // cxx20-warning {{increment of object of volatile-qualified type 'volatile int' is deprecated}} n--; // cxx20-warning {{decrement of object of volatile-qualified type 'volatile int' is deprecated}} - n += 5; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}} - n *= 3; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}} - n /= 2; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}} - n %= 42; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}} + n += 5; // undeprecated as a DR in C++23 + n *= 3; // undeprecated as a DR in C++23 + n /= 2; // undeprecated as a DR in C++23 + n %= 42; // undeprecated as a DR in C++23 n &= 2; // undeprecated as a DR in C++23 n |= 2; // undeprecated as a DR in C++23 n ^= 2; // undeprecated as a DR in C++23 Index: clang/test/CXX/drs/dr26xx.cpp =================================================================== --- clang/test/CXX/drs/dr26xx.cpp +++ clang/test/CXX/drs/dr26xx.cpp @@ -78,3 +78,13 @@ }; int i0 = f<X>(0); //expected-error {{no matching function for call to 'f'}} } + +namespace dr2654 { // dr2654: 16 +void f() { + int neck, tail; + volatile int brachiosaur; + brachiosaur += neck; // OK + brachiosaur -= neck; // OK + brachiosaur |= neck; // OK +} +} Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -13982,19 +13982,6 @@ // type is deprecated unless the assignment is either a discarded-value // expression or an unevaluated operand ExprEvalContexts.back().VolatileAssignmentLHSs.push_back(LHSExpr); - } else { - // C++20 [expr.ass]p6: - // [Compound-assignment] expressions are deprecated if E1 has - // volatile-qualified type and op is not one of the bitwise - // operators |, &, Ë. - switch (Opc) { - case BO_OrAssign: - case BO_AndAssign: - case BO_XorAssign: - break; - default: - Diag(Loc, diag::warn_deprecated_compound_assign_volatile) << LHSType; - } } } Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -7627,9 +7627,6 @@ def warn_deprecated_simple_assign_volatile : Warning< "use of result of assignment to object of volatile-qualified type %0 " "is deprecated">, InGroup<DeprecatedVolatile>; -def warn_deprecated_compound_assign_volatile : Warning< - "compound assignment to object of volatile-qualified type %0 is deprecated">, - InGroup<DeprecatedVolatile>; def warn_deprecated_volatile_return : Warning< "volatile-qualified return type %0 is deprecated">, InGroup<DeprecatedVolatile>; Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -607,6 +607,8 @@ conforming GNU extensions. Projects incompatible with C++17 can add ``-std=gnu++14`` to their build settings to restore the previous behaviour. - Implemented DR2358 allowing init captures in lambdas in default arguments. +- implemented `DR2654 <https://wg21.link/cwg2654>`_ which undeprecates + all compound assignements operations on volatile qualified variables. C++20 Feature Support ^^^^^^^^^^^^^^^^^^^^^ Index: clang-tools-extra/clangd/Diagnostics.cpp =================================================================== --- clang-tools-extra/clangd/Diagnostics.cpp +++ clang-tools-extra/clangd/Diagnostics.cpp @@ -331,7 +331,6 @@ diag::warn_deprecated, diag::warn_deprecated_altivec_src_compat, diag::warn_deprecated_comma_subscript, - diag::warn_deprecated_compound_assign_volatile, diag::warn_deprecated_copy, diag::warn_deprecated_copy_with_dtor, diag::warn_deprecated_copy_with_user_provided_copy,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits