Add an __assume side-effects warning
authorHal Finkel <hfinkel@anl.gov>
Thu, 17 Jul 2014 14:25:55 +0000 (14:25 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 17 Jul 2014 14:25:55 +0000 (14:25 +0000)
commitf041733585024574a4965dd80e3931442bd8472d
treeed23b0c9aed88c7927097a20bc4336a2424017c2
parent9eef7423081e6427086a9243b380a9e254067b05
Add an __assume side-effects warning

In MS-compatibility mode, we support the __assume builtin. The __assume builtin
does not evaluate its arguments, and we should issue a warning if __assume is
provided with an argument with side effects (because these effects will be
discarded).

This is similar in spirit to the warnings issued by other compilers (Intel
Diagnostic 2261, MS Compiler Warning C4557).

llvm-svn: 213266
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/builtin-assume.c [new file with mode: 0644]