summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/string-plus-int.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make -Wstring-plus-int warns even if when the result is not out of boundsArnaud Bienner2019-01-031-12/+11
| | | | | | | | | | | | | | Summary: Patch by Arnaud Bienner Reviewers: sylvestre.ledru, thakis, serge-sans-paille Reviewed By: thakis Subscribers: arphaman, dyung, anemet, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D55382 llvm-svn: 350335
* Revert "Make -Wstring-plus-int warns even if when the result is not out of ↵Adam Nemet2018-12-141-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bounds" This reverts commit r349054. It's causing: FAILED: tools/clang/bindings/python/tests/CMakeFiles/check-clang-python FAIL: test_diagnostic_range (tests.cindex.test_diagnostics.TestDiagnostics) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py", line 55, in test_diagnostic_range self.assertEqual(len(tu.diagnostics), 1) AssertionError: 2 != 1 ====================================================================== FAIL: test_diagnostic_warning (tests.cindex.test_diagnostics.TestDiagnostics) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py", line 18, in test_diagnostic_warning self.assertEqual(len(tu.diagnostics), 2) AssertionError: 1 != 2 llvm-svn: 349117
* Make -Wstring-plus-int warns even if when the result is not out of boundsSylvestre Ledru2018-12-131-12/+11
| | | | | | | | | | | | | | Summary: Patch by Arnaud Bienner Reviewers: sylvestre.ledru, thakis Reviewed By: thakis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55382 llvm-svn: 349054
* Sema: Don't diagnose string + int if the int is value dependentDavid Majnemer2014-12-151-0/+5
| | | | | | | | | | | Don't send a value dependent expression into the expression evaluator, HandleSizeof would crash. Making HandleSizeof handle dependent types would noisily warn about the operation even if everything turns out OK after instantiation. This fixes PR21848. llvm-svn: 224240
* Add a test for the -Wstring-plus-int fixit note.Nico Weber2012-03-021-0/+4
| | | | llvm-svn: 151951
* Add -Wstring-plus-int, which warns on "str" + int and int + "str".Nico Weber2012-03-021-0/+62
It doesn't warn if the integer is known at compile time and within the bounds of the string. Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203 llvm-svn: 151943
OpenPOWER on IntegriCloud