Created
July 15, 2015 21:34
-
-
Save hacst/f1728593df0c7b23e29d to your computer and use it in GitHub Desktop.
Basic test case for SWIG code generation producing valid code not accepted by MSVC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module EnumClassGenerationIssue | |
%include <std_vector.i> | |
%inline { | |
enum class TestEnum {}; | |
} | |
%template(TestEnumVector) std::vector<TestEnum>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When building a wrapper for say java from this with SWIG 3.0.6 generates snippets like:
std::vector< enum TestEnum >::value_type temp2 ;
Which trigger:
In MSVC. This has been reported as a bug against MSVC multiple times but doesn't seem to be something they want to fix:
https://connect.microsoft.com/VisualStudio/feedback/details/781517/enum-class-example-from-c-11-standard-produces-compilation-error
https://connect.microsoft.com/VisualStudio/feedback/details/771978/compiler-error-c3431-using-elaborated-type-specifiers-for-scoped-enumerations