Skip to content
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

Fix support for C++ enum classes #2767

Merged
merged 1 commit into from
Feb 2, 2019
Merged

Fix support for C++ enum classes #2767

merged 1 commit into from
Feb 2, 2019

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Dec 24, 2018

The current code fails to compile with:

<source>:3:54: error: invalid operands to binary expression ('enum E' and 'enum E')
const enum E neg_one_class_29 = (enum E) ((enum E) 0 - (enum E) 1);
                                          ~~~~~~~~~~ ^ ~~~~~~~~~~

This change reverts to the code that was before #2186 but silences erroneous GCC warning enabled by -Wconversion (which is not a part of -Wall).

Fixes #2749


Alternatively Cython can revert to the state before #2186 without adding GCC pragmas because the warning is a GCC bug with -Wconversion, which is not enabled even by -Wall.

The current code fails to compile with:

<source>:3:54: error: invalid operands to binary expression ('enum E' and 'enum E')
const enum E neg_one_class_29 = (enum E) ((enum E) 0 - (enum E) 1);
                                          ~~~~~~~~~~ ^ ~~~~~~~~~~

This change reverts to the code that was before cython#2186 but silences erroneous GCC warning enabled by -Wconversion (which is not a part of -Wall).

Fixes cython#2749
Copy link
Contributor

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

+1

@robertwb
Copy link
Contributor

robertwb commented Feb 2, 2019

This seems like a net improvement. Thanks.

@robertwb robertwb merged commit b00fd6a into cython:master Feb 2, 2019
@scoder scoder added this to the 0.29.5 milestone Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants