[all-commits] [llvm/llvm-project] 0c6599: [OpenCL] Fix default address space in template arg...

Anastasia Stulova via All-commits all-commits at lists.llvm.org
Thu Feb 4 05:53:42 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c65993be186640463ac90415113474d35889dbb
      https://github.com/llvm/llvm-project/commit/0c65993be186640463ac90415113474d35889dbb
  Author: Anastasia Stulova <anastasia.stulova at arm.com>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/test/SemaOpenCLCXX/address-space-templates.cl

  Log Message:
  -----------
  [OpenCL] Fix default address space in template argument deduction.

When deducing a reference type for forwarding references prevent
adding default address space of a template argument if it is given.

This got reported in PR48896 because in OpenCL all parameters are
in private address space and therefore when we initialize a
forwarding reference with a parameter we should just inherit the
address space from it i.e. keep __private instead of __generic.

Tags: #clang

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




More information about the All-commits mailing list