Encountered the same bug on release g2.4.0 on Ubuntu 14.04 LTS 64 bit. It's still long-term-supported, but old-ish.
Following the gzdoom wiki steps, it compiles by default with /usr/bin/c++ which appears to be a wrapper for gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
The normal CMakeFlags include -std=gnu++1y . I tried to change the CXX_FLAGS to adding -std=c++14 , but that option is unrecognized until a later gcc (5.2 I remember reading). Then I tried adding -std=c++1y, which is recognized, but I guess still doesn't include the feature.
your patch did resolve that issue. Thanks.
--- gl_ambientshader.cpp.orig 2017-04-18 02:30:41.462766707 -0700
+++ gl_ambientshader.cpp 2017-04-18 02:34:44.638760737 -0700
@@ -39,7 +39,7 @@
if (!mShader)
{
- mShader = std::make_unique<FShaderProgram>();
+ mShader.reset(new FShaderProgram());
mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330);
mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/lineardepth.fp", multisample ? "#define MULTISAMPLE\n" : "", 330);
mShader->SetFragDataLocation(0, "FragColor");
@@ -67,7 +67,7 @@
if (!mShader)
{
- mShader = std::make_unique<FShaderProgram>();
+ mShader.reset(new FShaderProgram());
mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330);
mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/ssao.fp", GetDefines(gl_ssao, multisample), 330);
mShader->SetFragDataLocation(0, "FragColor");
@@ -143,7 +143,7 @@
if (!mShader)
{
- mShader = std::make_unique<FShaderProgram>();
+ mShader.reset(new FShaderProgram());
mShader->Compile(FShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 330);
mShader->Compile(FShaderProgram::Fragment, "shaders/glsl/ssaocombine.fp", multisample ? "#define MULTISAMPLE\n" : "", 330);
mShader->SetFragDataLocation(0, "FragColor");
Not knowing much about that code, it seems worrying to invoke methods on something which satisfies (!mShader). But I guess that's done before the check as well. Operator overloading for logical not?