This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP]Fix PR46357: Do not allow types declarations in pragmas.
ClosedPublic

Authored by ABataev on Jun 17 2020, 8:25 AM.

Details

Summary

Compiler may erroneously treat current context in OpenMP pragmas as the
context where new type declaration/definition is allowed. But the
declartation/definition of the new types in OpenMP pragmas should not be
allowed.

Diff Detail

Event Timeline

ABataev created this revision.Jun 17 2020, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2020, 8:25 AM

Hm, does the standard say this is not allowed? I can see that we don't want it but I'm not 100% certain here.

Hm, does the standard say this is not allowed? I can see that we don't want it but I'm not 100% certain here.

It does not say anything specific, but I don't think it is a good idea to declare a new type in the OpenMP directive. But you can still declare a new type in the structured block.

jdoerfert accepted this revision.Jun 18 2020, 7:16 AM

I agree it is not a good idea. Let's hope no one will complain :) LGTM.

This revision is now accepted and ready to land.Jun 18 2020, 7:16 AM
This revision was automatically updated to reflect the committed changes.