Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Detect C++ language from compiler arguments #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ArthurVasseur wants to merge 1 commit into standardese:main
base: main
Choose a base branch
Loading
from ArthurVasseur:cppdetection

Conversation

@ArthurVasseur
Copy link

@ArthurVasseur ArthurVasseur commented Feb 8, 2025

This PR improves C++ language detection by analyzing compiler arguments.

Before my PR, the language was detected by checking if "++" existed in the compiler name. This approach is incorrect in certain cases.

// If ++ exists within the compiler name (e.g. clang++, g++, etc), use C++
std::string exe(clang_getCString(clang_CompileCommand_getArg(cmd, 0)));
use_c_ = (exe.find("++", 0) == std::string::npos);

e.g my build utility xmake is only using clang not clang++ in the compile_commands.json and setting -std=c++20.

edouard-sn reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /