]> granicus.if.org Git - clang/commit
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)
commitab2d8381a390bfef718dcdbbb2c104f12e10b414
treeb4d9a2a42093e1d456163363c0933d5028be154d
parent3c57879f0dd98cf30cdc0672ad727f150d304c1f
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213266 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaChecking.cpp
test/Sema/builtin-assume.c [new file with mode: 0644]