Skip to content

Commit 72f9bff

Browse files
committed
Revert "[C2y] Modify diagnostics for complex increment/decrement"
This reverts commit 1a42255. It broke post-commit CI bots: https://lab.llvm.org/buildbot/#/builders/144/builds/1428
1 parent 12a1e6d commit 72f9bff

File tree

3 files changed

+4
-75
lines changed

3 files changed

+4
-75
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7664,12 +7664,8 @@ def ext_gnu_ptr_func_arith : Extension<
76647664
InGroup<GNUPointerArith>;
76657665
def err_readonly_message_assignment : Error<
76667666
"assigning to 'readonly' return result of an Objective-C message not allowed">;
7667-
def ext_c2y_increment_complex : Extension<
7668-
"'%select{--|++}0' on an object of complex type is a C2y extension">,
7669-
InGroup<C2y>;
7670-
def warn_c2y_compat_increment_complex : Warning<
7671-
"'%select{--|++}0' on an object of complex type is incompatible with C "
7672-
"standards before C2y">, InGroup<CPre2yCompat>, DefaultIgnore;
7667+
def ext_increment_complex : Extension<
7668+
"'%select{--|++}0' on an object of complex type is a Clang extension">;
76737669
def ext_integer_complement_complex : Extension<
76747670
"ISO C does not support '~' for complex conjugation of %0">;
76757671
def err_nosetter_property_assignment : Error<

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13764,9 +13764,8 @@ static QualType CheckIncrementDecrementOperand(Sema &S, Expr *Op,
1376413764
return QualType();
1376513765
} else if (ResType->isAnyComplexType()) {
1376613766
// C99 does not support ++/-- on complex types, we allow as an extension.
13767-
S.Diag(OpLoc, S.getLangOpts().C2y ? diag::warn_c2y_compat_increment_complex
13768-
: diag::ext_c2y_increment_complex)
13769-
<< IsInc << Op->getSourceRange();
13767+
S.Diag(OpLoc, diag::ext_increment_complex)
13768+
<< IsInc << Op->getSourceRange();
1377013769
} else if (ResType->isPlaceholderType()) {
1377113770
ExprResult PR = S.CheckPlaceholderExpr(Op);
1377213771
if (PR.isInvalid()) return QualType();

clang/test/C/C2y/n3259.c

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)