summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/switch-1.c
Commit message (Collapse)AuthorAgeFilesLines
* Explicitly permit undefined behavior in constant initializers for globalRichard Smith2015-12-081-3/+0
| | | | | | | | variables in C, in the cases where we can constant-fold it to a value regardless (such as floating-point division by zero and signed integer overflow). Strictly enforcing this rule breaks too much code. llvm-svn: 254992
* PR17381: Treat undefined behavior during expression evaluation as an unmodeledRichard Smith2015-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | side-effect, so that we don't allow speculative evaluation of such expressions during code generation. This caused a diagnostic quality regression, so fix constant expression diagnostics to prefer either the first "can't be constant folded" diagnostic or the first "not a constant expression" diagnostic depending on the kind of evaluation we're doing. This was always the intent, but didn't quite work correctly before. This results in certain initializers that used to be constant initializers to no longer be; in particular, things like: float f = 1e100; are no longer accepted in C. This seems appropriate, as such constructs would lead to code being executed if sanitizers are enabled. llvm-svn: 254574
* [Tests] Modified Lit Tests to be C++11 compatibileCharles Li2015-08-271-5/+37
| | | | | | | This 2nd patch should not change the test results, but it is useful if clang's default C++ language is ever changed from gnu++98. llvm-svn: 246183
* Patch to warn on interger overflow in presence ofFariborz Jahanian2014-10-141-0/+5
| | | | | | | implicit casts. Reviewed by Reid Kleckner. rdar://18405357 llvm-svn: 219712
* c: Also chek for integer overflow for '%' operator.Fariborz Jahanian2013-03-151-0/+1
| | | | llvm-svn: 177163
* c: add the missing binary operatory when checkingFariborz Jahanian2013-03-151-0/+3
| | | | | | for integer overflow. // rdar://13423975 llvm-svn: 177162
* Add space after ';'.Fariborz Jahanian2013-01-251-4/+4
| | | | llvm-svn: 173462
* Improve diagnsotic further on integer overflow.Fariborz Jahanian2013-01-251-4/+5
| | | | llvm-svn: 173461
* Fixes text of diagnostics in integer overflow patch.Fariborz Jahanian2013-01-241-3/+3
| | | | llvm-svn: 173388
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-241-4/+4
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* Improve diagnostic per Richard's suggestionFariborz Jahanian2013-01-111-2/+2
| | | | | | | (which may yet change if we move the diagnostic outside case value). llvm-svn: 172242
* Provide a better warning when case value overflows.Fariborz Jahanian2013-01-101-2/+2
| | | | | | // rdar://11577384 llvm-svn: 172102
* Issue warning when case value is too large to fitFariborz Jahanian2013-01-091-0/+17
in case condition type. // rdar://11577384. Test is conditionalized on x86_64-apple triple as I am not sure if the INT_MAX/LONG_MAX values in the test will pass this test for other hosts. llvm-svn: 172016
OpenPOWER on IntegriCloud