Skip to content

[requires CppInterOp 1.9.0 release] Use Cpp::GetLanguageStandard to get language standard#461

Draft
mcbarton wants to merge 1 commit intocompiler-research:mainfrom
mcbarton:detect-standard-via-c++
Draft

[requires CppInterOp 1.9.0 release] Use Cpp::GetLanguageStandard to get language standard#461
mcbarton wants to merge 1 commit intocompiler-research:mainfrom
mcbarton:detect-standard-via-c++

Conversation

@mcbarton
Copy link
Collaborator

With CppInterOp 1.9.0, an API was created which can detect the c/c++ standard used (Cpp::GetLanguageStandard). This PR replaces get_stdopt xeus-cpp is currently using with Cpp::GetLanguageStandard. This PR needs testing and I will check it in the coming days.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

//NOLINTNEXTLINE (cppcoreguidelines-pro-bounds-pointer-arithmetic)
createInterpreter(Args(argv ? argv + 1 : argv, argv + argc));
m_version = get_stdopt();
m_version = Cpp::GetLanguageStandard(nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'm_version' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]

src/xinterpreter.cpp:78:

-         xmagics()
+         m_version(GetLanguageStandard(nullptr)), xmagics()
Suggested change
m_version = Cpp::GetLanguageStandard(nullptr);

//NOLINTNEXTLINE (cppcoreguidelines-pro-bounds-pointer-arithmetic)
createInterpreter(Args(argv ? argv + 1 : argv, argv + argc));
m_version = get_stdopt();
m_version = Cpp::GetLanguageStandard(nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no member named 'GetLanguageStandard' in namespace 'CppImpl' [clang-diagnostic-error]

        m_version = Cpp::GetLanguageStandard(nullptr);
                         ^

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.

1 participant