]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.cpp
Explicitly call base class copy constructor for expressions
[libs/gl.git] / source / glsl / syntax.cpp
index bda0dd1d7b2a0d673bcea91fc1fdbab23307ce37..90e26c39a37c24d663dc8846bb172f65007ec694 100644 (file)
@@ -67,7 +67,7 @@ NodeContainer<C>::NodeContainer(const NodeContainer &c):
 
 
 Statement::Statement():
-       source(0),
+       source(GENERATED_SOURCE),
        line(1)
 { }
 
@@ -107,6 +107,7 @@ VariableReference::VariableReference():
 { }
 
 VariableReference::VariableReference(const VariableReference &other):
+       Expression(other),
        name(other.name),
        declaration(0)
 { }
@@ -122,6 +123,7 @@ InterfaceBlockReference::InterfaceBlockReference():
 { }
 
 InterfaceBlockReference::InterfaceBlockReference(const InterfaceBlockReference &other):
+       Expression(other),
        name(other.name),
        declaration(0)
 { }
@@ -137,6 +139,7 @@ MemberAccess::MemberAccess():
 { }
 
 MemberAccess::MemberAccess(const MemberAccess &other):
+       Expression(other),
        left(other.left),
        member(other.member),
        declaration(0)
@@ -170,6 +173,7 @@ Assignment::Assignment():
 { }
 
 Assignment::Assignment(const Assignment &other):
+       BinaryExpression(other),
        self_referencing(other.self_referencing),
        target_declaration(0)
 { }
@@ -181,15 +185,16 @@ void Assignment::visit(NodeVisitor &visitor)
 
 
 FunctionCall::FunctionCall():
-       declaration(0),
-       constructor(false)
+       constructor(false),
+       declaration(0)
 { }
 
 FunctionCall::FunctionCall(const FunctionCall &other):
+       Expression(other),
        name(other.name),
-       declaration(0),
        constructor(other.constructor),
-       arguments(other.arguments)
+       arguments(other.arguments),
+       declaration(0)
 { }
 
 void FunctionCall::visit(NodeVisitor &visitor)
@@ -241,25 +246,26 @@ void StructDeclaration::visit(NodeVisitor &visitor)
 
 VariableDeclaration::VariableDeclaration():
        constant(false),
-       type_declaration(0),
        array(false),
+       type_declaration(0),
        linked_declaration(0)
 { }
 
 VariableDeclaration::VariableDeclaration(const VariableDeclaration &other):
+       Statement(other),
+       layout(other.layout),
        constant(other.constant),
        sampling(other.sampling),
        interpolation(other.interpolation),
        interface(other.interface),
        precision(other.precision),
        type(other.type),
-       type_declaration(0),
        name(other.name),
        array(other.array),
        array_size(other.array_size),
        init_expression(other.init_expression),
-       linked_declaration(0),
-       layout(other.layout)
+       type_declaration(0),
+       linked_declaration(0)
 { }
 
 VariableDeclaration::~VariableDeclaration()
@@ -282,6 +288,7 @@ InterfaceBlock::InterfaceBlock():
 }
 
 InterfaceBlock::InterfaceBlock(const InterfaceBlock &other):
+       Statement(other),
        interface(other.interface),
        name(other.name),
        members(other.members),
@@ -307,11 +314,12 @@ FunctionDeclaration::FunctionDeclaration():
 { }
 
 FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other):
+       Statement(other),
        return_type(other.return_type),
        name(other.name),
        parameters(other.parameters),
-       definition(other.definition==&other ? this : 0),
-       body(other.body)
+       body(other.body),
+       definition(other.definition==&other ? this : 0)
 { }
 
 void FunctionDeclaration::visit(NodeVisitor &visitor)