Previously, it had been using CK_BitCast even for casts that only
change const/restrict/volatile. Now it will use CK_Noop where
appropriate.
This is an alternate solution to r336746.
Paths
| Differential D52918
Emit CK_NoOp casts in C mode, not just C++. ClosedPublic Authored by jyknight on Oct 4 2018, 5:18 PM.
Details Summary Previously, it had been using CK_BitCast even for casts that only This is an alternate solution to r336746.
Diff Detail
Event TimelineComment Actions Patch is missing tests -- perhaps you could dump the AST and check the casting notation from the output? Comment Actions
It would appear that which casts get emitted in C mode is almost completely untested. I added tests just for this change in a new file, and left a TODO to fill it out for the remainder of those functions. This revision is now accepted and ready to land.Oct 5 2018, 11:44 AM Closed by commit rC343892: Emit CK_NoOp casts in C mode, not just C++. (authored by jyknight). · Explain WhyOct 5 2018, 2:55 PM Closed by commit rL343892: Emit CK_NoOp casts in C mode, not just C++. (authored by jyknight). · Explain Why This revision was automatically updated to reflect the committed changes. This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 168541 lib/AST/ExprConstant.cpp
lib/Sema/SemaExpr.cpp
test/Sema/c-casts.c
|