break with "too many }'s" and "got EOF" when C++11 enum class is used

Bug #1151766 reported by LeForgeron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pmccabe (Ubuntu)
New
Undecided
Unassigned

Bug Description

Whenever an enum uses the C++11 feature of "enum class", the parsing of the file is interrupted (remaining of file is not processed, at least on longer file some functions are not documented)

Sample test (file aa.hpp):

namespace Foo
{

class Bar
{
public:
    Bar() {}
    ~Bar() {}
    enum class foobar
    {
        YES, NO, FILE_NOT_FOUND
    };
    void hello();
};
}

Output: (pmccabe aa.hpp)
1 1 0 7 1 aa.hpp(7): Foo::Bar::Bar
1 1 0 8 1 aa.hpp(8): Foo::Bar::~Bar
"aa.hpp", line 12: too many }'s
"aa.hpp", line 16: unexpected EOF

$ lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10

$ apt-cache policy pmccabe
pmccabe:
  Installed: 2.6
  Candidate: 2.6
  Version table:
 *** 2.6 0
        500 http://ftp.free.org/mirrors/archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages
        100 /var/lib/dpkg/status

What I would have expected to happen: successful processing of the file, as when the "enum class" is replaced by "enum"

Revision history for this message
Simon Josefsson (simon-josefsson) wrote :

Thanks for the report! Solved upstream with the 2.8 release, see https://gitlab.com/pmccabe/pmccabe/-/commit/dee9f7e06fe6b072a890ad2240ac23df8c7c97c4

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.