[PATCH] D119615: [CUDA][HIP] Do not promote constexpr var with non-constant initializer

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 11 20:34:58 PST 2022


yaxunl created this revision.
yaxunl added a reviewer: tra.
yaxunl requested review of this revision.

constexpr var may be initialized with address of non-const variable.
In this case the initializer is not constant in device compilation.
This has been handled for const vars but not for constexpr vars.

This patch makes handling of const var and constexpr var
consistent.


https://reviews.llvm.org/D119615

Files:
  clang/lib/Sema/SemaCUDA.cpp
  clang/test/SemaCUDA/constexpr-var.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119615.408145.patch
Type: text/x-patch
Size: 4974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220212/1279c408/attachment-0001.bin>


More information about the cfe-commits mailing list