Skip to content

Commit 6ce4604

Browse files
committed
fix cast
1 parent b719c92 commit 6ce4604

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14458,7 +14458,6 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
1445814458
case CK_IntegralComplexToFloatingComplex:
1445914459
case CK_BuiltinFnToFnPtr:
1446014460
case CK_ZeroToOCLOpaqueType:
14461-
case CK_NonAtomicToAtomic:
1446214461
case CK_AddressSpaceConversion:
1446314462
case CK_IntToOCLSampler:
1446414463
case CK_FloatingToFixedPoint:
@@ -14482,6 +14481,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
1448214481
case CK_UserDefinedConversion:
1448314482
case CK_LValueToRValue:
1448414483
case CK_AtomicToNonAtomic:
14484+
case CK_NonAtomicToAtomic:
1448514485
case CK_NoOp:
1448614486
case CK_LValueToRValueBitCast:
1448714487
case CK_HLSLArrayRValue:

clang/test/AST/atomic-expr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -fsyntax-only %s -verify
2+
// expected-no-diagnostics
3+
4+
typedef _Atomic char atomic_char;
5+
6+
atomic_char counter;
7+
8+
char load_plus_one() {
9+
return ({ counter; }) + 1;
10+
}

0 commit comments

Comments
 (0)