This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] For checker `readability-misleading-indentation` update tests.
ClosedPublic

Authored by Abpostelnicu on Jan 9 2020, 12:04 AM.

Details

Summary

In D72333 we've introduced support for if constexpr but the test for uninstantiated template was not ready to land on windows platform since this target uses -fdelayed-template-parsing by default. This patch addresses this by passing -fno-delayed-template-parsing to the test.

Diff Detail

Event Timeline

Abpostelnicu created this revision.Jan 9 2020, 12:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2020, 12:04 AM
Abpostelnicu edited the summary of this revision. (Show Details)Jan 9 2020, 12:05 AM
Abpostelnicu added a project: Restricted Project.

Hm, didn't clang gain such a diagnostic itself recently? https://godbolt.org/z/MYJTvw
Wouldn't it make sense to migrate everything into it, and drop this now-duplicating check?

Hm, didn't clang gain such a diagnostic itself recently? https://godbolt.org/z/MYJTvw
Wouldn't it make sense to migrate everything into it, and drop this now-duplicating check?

True, but for the moment we are currently using this check in our review-time infrastructure si I'm not sure If we want to drop this just yet.

JonasToth accepted this revision.Jan 9 2020, 2:25 AM

LGTM.
This check already existed in clang-tidy and had a bug. So we should fix that (thank you for that) and probably even backport (release coming soon).
So even though clang itself might be able to do it, clang-tidy should do it properly as well.

This revision is now accepted and ready to land.Jan 9 2020, 2:25 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Jan 9 2020, 4:28 AM

I'll point out that with this approach we lose all test coverage of the checker with delayed template parsing on, even though most of the test works in that mode and delayed template parsing is the default when targeting windows.

I'll point out that with this approach we lose all test coverage of the checker with delayed template parsing on, even though most of the test works in that mode and delayed template parsing is the default when targeting windows.

That is common in clang-tidies tests, because when the templates are not parsed, the diagnostics are not emitted. But that is not a problem, because the templates only make problems when different instantiation and the template itself create different / conflicting diagnostics.
But here that is ok.