Skip to content

Conversation

googlewalt
Copy link
Contributor

@googlewalt googlewalt commented Sep 2, 2025

This fixes an issue with #150791. In CheckRunner, we treat files with unrecognized extensions as ".cpp", by forcefully assigning extension = ".cpp" if it's not already one of ".c", ".hpp", ".m", or ".mm". Make the new code which chooses the default -std argument be consistent with that, so that using other file extensions doesn't trigger an error message like error: invalid argument '-std=c99' not allowed with 'C++'

In CheckRunner, we treat files with unrecognized extensions as ".cpp".
Make the new code be consistent with that.
@googlewalt googlewalt changed the title [clang-tidy] Fix file extension inconsistency from #150791 [clang-tidy] Fix file extension inconsistency Sep 2, 2025
@googlewalt googlewalt requested a review from jyknight September 2, 2025 20:44
Copy link

github-actions bot commented Sep 2, 2025

✅ With the latest revision this PR passed the Python code formatter.

@nicovank
Copy link
Contributor

nicovank commented Sep 2, 2025

Assuming you're talking about this default?

if extension not in [".c", ".hpp", ".m", ".mm"]:
extension = ".cpp"

Seems fine to me. I'll defer to @localspook.

@googlewalt
Copy link
Contributor Author

Assuming you're talking about this default?

Yes. This addresses some internal tests breakages.

Copy link
Member

@jyknight jyknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the new change produces clearly incorrect behavior currently, I'm gonna approve+merge this.

@jyknight jyknight merged commit f1c9950 into llvm:main Sep 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants