Commit Graph

3 Commits

Author SHA1 Message Date
David Majnemer 69e6d60861 Sema: Don't diagnose string + int if the int is value dependent
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 10:00:35 +00:00
Nico Weber ff1e9cce64 Add a test for the -Wstring-plus-int fixit note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:01:20 +00:00
Nico Weber 1cb2d742eb Add -Wstring-plus-int, which warns on "str" + int and int + "str".
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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:01:22 +00:00