This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Fix checking dependent initalizer
ClosedPublic

Authored by yaxunl on Feb 1 2021, 5:32 PM.

Details

Summary

Defer constant checking of dependent initializer to template instantiation
since it cannot be done for dependent values.

This is separated from https://reviews.llvm.org/D95560

Diff Detail

Event Timeline

yaxunl requested review of this revision.Feb 1 2021, 5:32 PM
yaxunl created this revision.
tra accepted this revision.Feb 2 2021, 11:24 AM
tra added inline comments.
clang/lib/Sema/SemaCUDA.cpp
538

Nit, no need for () any more, as all parts of the expression ar ||-ed together.

clang/test/SemaCUDA/dependent-device-var.cu
9

So, the patch now allows using type-dependent constant expressions now.
I'd add a comment highlighting this. It's not always obvious that the test's purpose is to verify the absence of an error.

This revision is now accepted and ready to land.Feb 2 2021, 11:24 AM
yaxunl marked 2 inline comments as done.Feb 3 2021, 11:39 AM
yaxunl added inline comments.
clang/lib/Sema/SemaCUDA.cpp
538

will do

clang/test/SemaCUDA/dependent-device-var.cu
9

will do

This revision was automatically updated to reflect the committed changes.
yaxunl marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2021, 3:05 PM