[all-commits] [llvm/llvm-project] c310bf: [Sema] Comparison of pointers to complete and inco...

Benson Chu via All-commits all-commits at lists.llvm.org
Fri Jun 19 17:03:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c310bf8256f83f365921562cebc5e4c9aec8e87e
      https://github.com/llvm/llvm-project/commit/c310bf8256f83f365921562cebc5e4c9aec8e87e
  Author: Benson Chu <bensonchu457 at gmail.com>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExpr.cpp
    A clang/test/Sema/complete-incomplete-pointer-relational-c99.c

  Log Message:
  -----------
  [Sema] Comparison of pointers to complete and incomplete types

Clang is missing one of the conditions for C99 6.5.9p2, where comparison
between pointers must either both point to incomplete types or both
point to complete types. This patch adds an extra check to the clause
where two pointers are of compatible types.

This only applies to C89/C99; the relevant part of the standard was
rewritten for C11.

Differential Revision: https://reviews.llvm.org/D79945




More information about the All-commits mailing list