SWIG misparses a method name in parentheses #45

ojwb opened this Issue May 1, 2013 · 0 comments


None yet
1 participant

ojwb commented May 1, 2013

SWIG misparses a method name in parentheses, which is sometimes used to avoid macro expansion (if there was a foo macro taking one argument in this case):

%module misparse
%inline %{
struct Foo {
    int (foo)(int i);

With current trunk:

$ ./preinst-swig -c++ -python misparse.i 
misparse.i:3: Warning 504: Function Foo::int(foo) must have a return type. Ignored.

I believe this is valid C++ - GCC and clang are both happy with it.

I've not dug into the parser to try to work out what's happening.

@ojwb ojwb added the bug label Feb 21, 2014

@ojwb ojwb added the parser label Sep 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment