LukasBanana / XShaderCompiler

Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL
BSD 3-Clause "New" or "Revised" License
352 stars 48 forks source link

Workaround GCC compiler bug #65

Closed mlomb closed 7 years ago

mlomb commented 7 years ago

In pre GCC 6.0 when you call a protected member inside a lambda function the compiler throws an error. Specifically, I got the bug compiling for Android from CMake using ANDROID_STL=c++_static and ANDROID_TOOLCHAIN=gcc.

This bug in StackOverflow: https://stackoverflow.com/questions/19850648/error-when-calling-base-member-function-from-within-a-lambda GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972

LukasBanana commented 7 years ago

Hello and thanks for your contribution.

Unfortunately, your fix may cause infinite recursion calls until a stack overflow: Parser::AcceptIt() must be called explicitly as part of the base class. HLSLParser::AcceptIt() overloads this function so this->AcceptIt(); will call the same function again and again ...

Maybe you can fix it with this: this->Parser::AcceptIt()?

Kind regards, Lukas

mlomb commented 7 years ago

Hello, When I read the brief on the email "until a stack overflow" it came the same to my head. Fixed now!

Thanks

LukasBanana commented 7 years ago

One more thing: can you please stash your commits into one? Thanks

mlomb commented 7 years ago

I have finally reset the branch and commit again.