This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Temporarily not use compiler intrinsics for some type traits in Objective-C++ mode.
AbandonedPublic

Authored by var-const on Feb 27 2023, 3:09 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

Currently, there are bugs in Clang's intrinsics for type traits when
handling Objective-C++ id (e.g. in add_pointer). As a temporary
workaround, don't use these intrinsics in the Objective-C++ mode.

Diff Detail

Event Timeline

var-const created this revision.Feb 27 2023, 3:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 3:09 PM
var-const requested review of this revision.Feb 27 2023, 3:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 3:09 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

@tstellar Would it be possible to merge this patch directly into the release/16.x branch? It's an important fix (compiler bug workaround) for the Objective-C++ mode that is affecting the LLVM 16 release. Unfortunately, the patch doesn't apply cleanly to main, and we also hope that the compiler bug would be fixed before the next release so that this workaround will become unnecessary. If merging to the release branch is not okay, I'm not sure what the correct workflow would be. I can make the fix on the main branch, but it won't cleanly cherry-pick into the release, so I'm not sure if the GitHub automation can handle that.

philnik added inline comments.
libcxx/include/__config
1262

Can you file a bug against Clang and link it here? This makes it easier to check whether the bug is fixed.

1264–1266

We normally disable stuff the other way around. Is there a reason to do it differently here?

var-const added inline comments.Feb 27 2023, 3:22 PM
libcxx/include/__config
1262

That's a good point, will do.

1264–1266

I used _LIBCPP_USING_DEV_RANDOM as the model, and I saw it more like "Are we allowed to use this feature?" rather than "Should we suppress the use of this feature?" I feel that our type traits are undertested and there might be more issues with the compiler intrinsics, so the default should be to use the old implementation (which, while still undertested in our code, is known to work in the wild with no major issues).

This is superseded by D145186, I'd suggest closing this. We'll cherry-pick onto release/16.x via the usual means