Skip to content

c++ standard ignored in MSVC  #180

Description

@ChristosT

It looks like the c++ standard is ignored if provided via the cflags when using MSVC

The example below fails in MSVC but success with gcc (10.5):

from pygccxml import parser
from pygccxml import utils

generator_path, generator_name = utils.find_xml_generator()

print(f"f{generator_path=}")
print(f"f{generator_name=}")
header="""
#include <variant>
std::variant<int, double, float> value;
"""

config = parser.xml_generator_configuration_t(
        xml_generator_path=generator_path,
        xml_generator=generator_name,
        cflags="-std=c++17",

)
parsed_declarations = parser.parse_string(
	header,
        config,
 )

Error:

C:\Users\User\AppData\Local\Temp\tmp9050xy28.h:3:6: error: no template named 'variant' in namespace 'std'
std::variant<int, double, float> value;
~~~~~^
1 error generated.

Using

castxml            0.4.5
pygccxml           2.5.0

and MSVC 19.39.33522

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions