Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Kaylor 93bd7cd32d Remove offset size check in nullptr arithmetic handling
Differential Revision: https://reviews.llvm.org/D37042



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 18:06:44 +00:00
Andrew Kaylor fdde3c7be7 Fix 32-bit buildbots by removing tests that are dependent on pointer-size comparisons.
The recently behavior in the code that these tests were meant to be checking will be ammended as soon as a suitable change can be properly reviewed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 21:43:01 +00:00
Andrew Kaylor cac5bac11b Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc
Differential Revision: https://reviews.llvm.org/D37042



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 20:26:40 +00:00
Nikola Smiljanic bba7fea0d0 PR10405 - Desugar FunctionType and TemplateSpecializationType if any type that appears inside needs to be desugared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242371 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 01:06:17 +00:00
David Majnemer 3a3e2d8e98 Sema: Semantically check _Atomic-qualified pointers
This fixes PR22568.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228959 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:07:34 +00:00
Chandler Carruth 6628969c3e Cleanup a fixme by using a specific diagnostic for subscripting
a pointer to void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 16:32:27 +00:00
Chandler Carruth 13b21be065 Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the
messages more consistent in the various contexts, especially in terms of
consistently diagnosing binary operators with invalid types on both the
left- and right-hand side. Also, improve the grammar and wording of the
messages some, handling both two pointers and two (different) types.

The wording of function pointer arithmetic diagnostics still strikes me
as poorly phrased, and I worry this makes them slightly more awkward if
more consistent. I'm hoping to fix that with a follow-on patch and test
case that will also make them more helpful when a typedef or template
type parameter makes the type completely opaque.

Suggestions on better wording are very welcome, thanks to Richard Smith
for some initial help on that front.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 08:02:19 +00:00
Chandler Carruth ae0bafa229 Fix a problem with the diagnostics of invalid arithmetic with function
pointers I found while working on the NULL arithmetic warning. We here
always assuming the LHS was the pointer, instead of using the selected
pointer expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 07:52:11 +00:00
Abramo Bagnara 46358457f7 Congruent diagnostic for void* arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 06:50:07 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Sebastian Redl 3cb069213c Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 19:52:04 +00:00
Douglas Gregor c983b86514 Support arithmetic on pointer-to-function types as a GNU
extension. Addresses clang PR/3371.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 00:36:41 +00:00
Douglas Gregor 4ec339f43c Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type). 
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 19:26:10 +00:00
Eli Friedman d72d16e6f1 Add proper type-checking for pointer additiion; before, we were accepting
addition with a pointer and an integer even when it didn't make sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-18 18:08:51 +00:00