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

cppclean suggests forward declaring something which is an enum #86

Closed
jwpeterson opened this issue Jan 5, 2016 · 1 comment
Closed

Comments

@jwpeterson
Copy link

But this isn't allowed by the C++03 standard. The following simple test code (two files) demonstrates the issue:

myenum.h:

enum MyEnum {FOO, BAR, BAZ};

cppclean_test4.h:

// Header file where enum MyEnum is defined.
#include "myenum.h"

class A
{
  // f takes a reference to MyEnum, but as an enum it can't be forward declared.
  void f(MyEnum & bar);
};

cppclean prints:

cppclean_test4.h:2: 'myenum.h' does not need to be #included; use a forward declaration instead
@r-e-d r-e-d closed this as completed in a1fd191 Jan 5, 2016
@r-e-d
Copy link
Collaborator

r-e-d commented Jan 5, 2016

Thanks for the report. This is fixed now :)

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

No branches or pull requests

2 participants