Incorrect emacs indentation in a C++ class with DLL export specification
- by Michael Daum
I often write classes with a DLL export/import specification, but this seems to confuse emacs' syntax parser. I end up with something like:
class myDllSpec Foo {
public:
Foo( void );
};
Notice that the "public:" access spec is indented incorrectly, as well as everything that follows it.
When I ask emacs to describe the syntax at the beginning of the line containing public, I get a return of:
((label 352))
If I remove the myDllSpec, the indentation is correct, and emacs tells me that the syntax there is:
((inclass 352) (access-label 352))
Which seems correct and reasonable. So I conclude that the syntax parser is not able to handle the DLL export spec, and that this is what's causing my indentation trouble.
Unfortunately, I don't know how to teach the parser about my labels. Seems that this is pretty common practice, so I'm hoping there's a way around it.