X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=b8710509e8d32fe424062f6c6558976ceab6da35;hp=4b38c5b755e935f0e3f477c0ecd092202e411c7f;hb=3f44e477f81983c66947fe8a6d8640a3b2f9e0b3;hpb=03880839dcd2c067061ac5491083159a9fd06611 diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 4b38c5b7..b8710509 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -239,10 +239,16 @@ void ReferenceValidator::visit(InterfaceBlockReference &iface) void ReferenceValidator::visit(FunctionCall &call) { - if(!call.declaration && !call.constructor) + if((!call.constructor && !call.declaration) || (call.constructor && !call.type)) { - map::iterator i = stage->functions.lower_bound(call.name); - if(i!=stage->functions.end() && i->second->name==call.name) + bool have_declaration = call.constructor; + if(!call.constructor) + { + map::iterator i = stage->functions.lower_bound(call.name); + have_declaration = (i!=stage->functions.end() && i->second->name==call.name); + } + + if(have_declaration) { bool valid_types = true; string signature; @@ -255,7 +261,7 @@ void ReferenceValidator::visit(FunctionCall &call) } if(valid_types) - error(call, format("No matching overload found for call to '%s(%s)'", call.name, signature)); + error(call, format("No matching %s found for '%s(%s)'", (call.constructor ? "constructor" : "overload"), call.name, signature)); } else error(call, format("Call to undeclared function '%s'", call.name));