[all-commits] [llvm/llvm-project] a1e2c6: [CUDA][HIP] ignore implicit host/device attr for o...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Mon Nov 20 13:07:02 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a1e2c6566305061c115954b048f2957c8d55cb5b
      https://github.com/llvm/llvm-project/commit/a1e2c6566305061c115954b048f2957c8d55cb5b
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2023-11-20 (Mon, 20 Nov 2023)

  Changed paths:
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/SemaCUDA/implicit-member-target-inherited.cu
    M clang/test/SemaCUDA/trivial-ctor-dtor.cu

  Log Message:
  -----------
  [CUDA][HIP] ignore implicit host/device attr for override (#72815)

When deciding whether a previous function declaration is an overload or
override, implicit host/device attrs should not be considered.

This fixes the failure for the following code:

`template <typename T>
class C {
    explicit C() {};
};

template <> C<int>::C() {};
`

The issue was introduced by
https://github.com/llvm/llvm-project/pull/72394

sine the template specialization is treated as overload due to implicit
host/device attrs are considered for overload/override differentiation.




More information about the All-commits mailing list