diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-06-20 07:52:11 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-06-20 07:52:11 +0000 |
commit | ae0bafa229d076a0fb90b5aeccea7e3039c58751 (patch) | |
tree | 6d329e2afe0efa314e0feb5dfef54f65334311ae /test/SemaCXX/null_in_arithmetic_ops.cpp | |
parent | c04985647bbd54d53b1f1219287eddce8ff530b5 (diff) |
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
Diffstat (limited to 'test/SemaCXX/null_in_arithmetic_ops.cpp')
-rw-r--r-- | test/SemaCXX/null_in_arithmetic_ops.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/SemaCXX/null_in_arithmetic_ops.cpp b/test/SemaCXX/null_in_arithmetic_ops.cpp index 9665c3959e..d9cfc5f89a 100644 --- a/test/SemaCXX/null_in_arithmetic_ops.cpp +++ b/test/SemaCXX/null_in_arithmetic_ops.cpp @@ -33,7 +33,7 @@ void f() { v = 0 ? NULL + d : d + NULL; // \ expected-error {{invalid operands to binary expression ('long' and 'void (X::*)()')}} \ expected-error {{invalid operands to binary expression ('void (X::*)()' and 'long')}} - v = 0 ? NULL + e : e + NULL; // expected-error 2{{arithmetic on pointer to function type}} + v = 0 ? NULL + e : e + NULL; // expected-error 2{{arithmetic on pointer to function type 'void (*)()'}} v = 0 ? NULL + f : f + NULL; // expected-warning 2{{use of NULL in arithmetic operation}} v = 0 ? NULL + "f" : "f" + NULL; // expected-warning 2{{use of NULL in arithmetic operation}} |