Ok, I've got a reproducible example. There are couple of necessary conditions:
- The class needs to be in proper h/cpp files. The problem doesn't occur when it's in a single cpp.
- The method in question needs to be in another cpp file (Qt generates signal method's bodies to a separate file).
Here's a sample:
//main.cpp
#include "TestClass.h"
int main()
{
TestClass t;
t.foo();
}
//TestClass.h
#pragma once
class TestClass
{
public:
void foo();
void bar();
};
//TestClass.cpp
#include "TestClass.h"
#define FOO
void TestClass::bar()
{
FOO foo(); //this is the troubled place
}
//Generated.cpp
#pragma once
#include "TestClass.h"
void TestClass::foo() {}
So without the FOO macro I get the correct result:
And when I add the macro I only get this: