]> granicus.if.org Git - clang/commit
Implement support for comparing pointers with <, >, <=, >=, ==, and !=
authorDouglas Gregor <dgregor@apple.com>
Mon, 4 May 2009 06:07:12 +0000 (06:07 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 4 May 2009 06:07:12 +0000 (06:07 +0000)
commit0c6db9417dceeb082296c4e097be5de3ee1c5eb7
treed9d087d431c9c75775098bd66cddf0213f06adf5
parent885c27bfd33c92412a3fb071c3f0fffc6b671783
Implement support for comparing pointers with <, >, <=, >=, ==, and !=
in C++, taking into account conversions to the "composite pointer
type" so that we can compare, e.g., a pointer to a derived class to a
pointer to a base class.

Also, upgrade the "comparing distinct pointer types" from a warning to
an error for C++, since this is clearly an error. Turns out that we
hadn't gone through and audited this code for C++, ever.

Fixes <rdar://problem/6816420>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70829 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/composite-pointer-type.cpp [new file with mode: 0644]
test/SemaCXX/elaborated-type-specifier.cpp