From: Mikko Rasa Date: Thu, 4 Mar 2021 15:57:00 +0000 (+0200) Subject: Check for function declaration conflicting with something else X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f2725633d775ef21c3e2cffc2cbf14cdc83e8ca2;p=libs%2Fgl.git Check for function declaration conflicting with something else Functions are allowed to have multiple declarations but only one definition. --- diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 5fd4ebca..f3390048 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -95,6 +95,10 @@ void DeclarationValidator::visit(InterfaceBlock &iface) void DeclarationValidator::visit(FunctionDeclaration &func) { + if(Statement *previous = find_definition(func.name)) + if(!dynamic_cast(previous)) + multiple_definition(format("'%s'", func.name), func, *previous); + if(func.definition==&func) check_definition(func.name, func); TraversingVisitor::visit(func);