]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/validate.cpp
Resolve the return types of functions
[libs/gl.git] / source / glsl / validate.cpp
index 8e5e996cb1f430ce1fe7c4103807c31a96f60a33..e6f0c653e45f4ad9e62c108084867dc4374c11c9 100644 (file)
@@ -201,6 +201,13 @@ void ReferenceValidator::visit(VariableDeclaration &var)
        TraversingVisitor::visit(var);
 }
 
+void ReferenceValidator::visit(FunctionDeclaration &func)
+{
+       if(!func.return_type_declaration)
+               error(func, format("Use of undeclared type '%s'", func.return_type));
+       TraversingVisitor::visit(func);
+}
+
 } // namespace SL
 } // namespace GL
 } // namespace Msp