This is an archive of the discontinued LLVM Phabricator instance.

Stop emit incomplete type error for a variable in an omp map clause where should not.
ClosedPublic

Authored by jyu2 on Jul 30 2021, 3:42 PM.

Details

Summary

Stop emit incomplete type error for a variable in a map clause
where should not.

Currently we are using QTy->isIncompleteType(&ND) to check incomplete
type. But before doing that, need to instantiate for a class template
specialization or a class member of a class template specialization,
or an array with known size of such..., so that we know it is really
incomplete type.

To fix this using RequireCompleteType instead.

The new test is added into "test/OpenMP/target_update_messages.cpp"

The different using RequireCompleteType when emit incomplete type, a
note is also emitted to point to where incomplete type is declared.
Because this change, many tests are needed to be fixed where adding
additional note.

This is to fix https://bugs.llvm.org/show_bug.cgi?id=50508

Diff Detail

Event Timeline

jyu2 requested review of this revision.Jul 30 2021, 3:42 PM
jyu2 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2021, 3:42 PM
Herald added a subscriber: sstefan1. · View Herald Transcript
ABataev accepted this revision.Jul 30 2021, 4:11 PM

LG with a nit.

clang/lib/Sema/SemaOpenMP.cpp
18446

Formatting?

This revision is now accepted and ready to land.Jul 30 2021, 4:11 PM
jyu2 updated this revision to Diff 363538.Aug 2 2021, 11:49 AM

Fix format problem.

This revision was automatically updated to reflect the committed changes.
jyu2 marked an inline comment as done.