[all-commits] [llvm/llvm-project] 85255a: [C++][Sema] Ignore top-level qualifiers in casts

Ole Strøhm via All-commits all-commits at lists.llvm.org
Mon Jul 5 04:28:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85255a04e5729c03214c51177aa885c055f3e242
      https://github.com/llvm/llvm-project/commit/85255a04e5729c03214c51177aa885c055f3e242
  Author: Ole Strohm <olemarius.strohm at arm.com>
  Date:   2021-07-05 (Mon, 05 Jul 2021)

  Changed paths:
    M clang/lib/Sema/SemaCast.cpp
    M clang/test/CodeGenOpenCLCXX/reinterpret_cast.clcpp
    M clang/test/SemaCXX/reinterpret-cast.cpp
    M clang/test/SemaCXX/warn-reinterpret-base-class.cpp
    M clang/test/SemaOpenCLCXX/addrspace_cast.clcpp
    M clang/test/SemaOpenCLCXX/reinterpret-cast.clcpp

  Log Message:
  -----------
  [C++][Sema] Ignore top-level qualifiers in casts

Ignore top-level qualifiers in casts, which fixes issues in reinterpret_cast.

This rule comes from [expr.type]/8.2.2 which explains that casting to a
pr-qualified type should actually cast to the unqualified type. In C++
this is only done for types that aren't classes or arrays.

Fixes: PR49221

Reviewed By: Anastasia

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




More information about the All-commits mailing list