Emit CK_NoOp casts in C mode, not just C++.
authorJames Y Knight <jyknight@google.com>
Fri, 5 Oct 2018 21:53:51 +0000 (21:53 +0000)
committerJames Y Knight <jyknight@google.com>
Fri, 5 Oct 2018 21:53:51 +0000 (21:53 +0000)
commit49bf370a8b38a9fde6979fb4be71c06c61671014
tree61a1477c9fa6354b7f56fd49fe3489ffa102a79f
parentdc97118efe3135cdaa4aa697e9f92ca6ea294fd3
Emit CK_NoOp casts in C mode, not just C++.

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.

Differential Revision: https://reviews.llvm.org/D52918

llvm-svn: 343892
clang/lib/AST/ExprConstant.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/c-casts.c [new file with mode: 0644]