Index: src/SynTree/Declaration.cc
===================================================================
--- src/SynTree/Declaration.cc	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/Declaration.cc	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Declaration.cc -- 
+// Declaration.cc --
 //
 // Author           : Richard C. Bilson
@@ -20,4 +20,5 @@
 #include "Initializer.h"
 #include "Type.h"
+#include "Attribute.h"
 #include "Common/utility.h"
 
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/Declaration.h	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -64,5 +64,5 @@
 class DeclarationWithType : public Declaration {
   public:
-	DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
+	DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes );
 	DeclarationWithType( const DeclarationWithType &other );
 	virtual ~DeclarationWithType();
@@ -75,4 +75,7 @@
 	int get_scopeLevel() const { return scopeLevel; }
 	void set_scopeLevel( int newValue ) { scopeLevel = newValue; }
+
+	std::list< Attribute * >& get_attributes() { return attributes; }
+	const std::list< Attribute * >& get_attributes() const { return attributes; }
 
 	virtual DeclarationWithType *clone() const = 0;
@@ -87,4 +90,6 @@
 	// shadowed identifiers can be accessed
 	int scopeLevel = 0;
+
+	std::list< Attribute * > attributes;
 };
 
@@ -92,5 +97,5 @@
 	typedef DeclarationWithType Parent;
   public:
-	ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline = false, bool isNoreturn = false );
+	ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
 	ObjectDecl( const ObjectDecl &other );
 	virtual ~ObjectDecl();
@@ -131,5 +136,4 @@
 	std::list< std::string >& get_oldIdents() { return oldIdents; }
 	std::list< Declaration* >& get_oldDecls() { return oldDecls; }
-	std::list< Attribute * >& get_attributes() { return attributes; }
 
 	virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
@@ -143,5 +147,4 @@
 	std::list< std::string > oldIdents;
 	std::list< Declaration* > oldDecls;
-	std::list< Attribute * > attributes;
 };
 
Index: src/SynTree/DeclarationWithType.cc
===================================================================
--- src/SynTree/DeclarationWithType.cc	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/DeclarationWithType.cc	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -16,15 +16,18 @@
 #include "Declaration.h"
 #include "Type.h"
+#include "Attribute.h"
 #include "Common/utility.h"
 
-DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
-		: Declaration( name, sc, linkage ) {
+DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes )
+		: Declaration( name, sc, linkage ), attributes( attributes ) {
 }
 
 DeclarationWithType::DeclarationWithType( const DeclarationWithType &other )
 		: Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ) {
+	cloneAll( other.attributes, attributes );
 }
 
 DeclarationWithType::~DeclarationWithType() {
+	deleteAll( attributes );
 }
 
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/Expression.cc	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -344,10 +344,11 @@
 }
 
+//// is this right? It's cloning the member, but the member is a declaration so probably shouldn't be cloned...
 MemberExpr::MemberExpr( const MemberExpr &other ) :
-		Expression( other ), member( maybeClone( other.member ) ), aggregate( maybeClone( other.aggregate ) ) {
+		Expression( other ), member( other.member ), aggregate( maybeClone( other.aggregate ) ) {
 }
 
 MemberExpr::~MemberExpr() {
-	delete member;
+	// delete member;
 	delete aggregate;
 }
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/FunctionDecl.cc	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -23,5 +23,5 @@
 
 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
-		: Parent( name, sc, linkage ), type( type ), statements( statements ), attributes( attributes ) {
+		: Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) {
 	set_isInline( isInline );
 	set_isNoreturn( isNoreturn );
@@ -34,5 +34,4 @@
 FunctionDecl::FunctionDecl( const FunctionDecl &other )
 	: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
-		cloneAll( other.attributes, attributes );
 }
 
@@ -40,5 +39,4 @@
 	delete type;
 	delete statements;
-	deleteAll( attributes );
 }
 
@@ -69,5 +67,5 @@
 	} // if
 
-	printAll( attributes, os, indent );
+	printAll( get_attributes(), os, indent );
 
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
Index: src/SynTree/Initializer.h
===================================================================
--- src/SynTree/Initializer.h	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/Initializer.h	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -93,6 +93,7 @@
 	std::list<Initializer*> &get_initializers() { return initializers; }
 
-	std::list<Initializer*>::iterator begin_initializers() { return initializers.begin(); }
-	std::list<Initializer*>::iterator end_initializers() { return initializers.end(); }
+	typedef std::list<Initializer*>::iterator iterator;
+	iterator begin() { return initializers.begin(); }
+	iterator end() { return initializers.end(); }
 
 	virtual ListInit *clone() const { return new ListInit( *this ); }
Index: src/SynTree/Label.h
===================================================================
--- src/SynTree/Label.h	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/Label.h	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -24,5 +24,5 @@
 class Label {
   public:
-	Label( const std::string & name = "", Statement * labelled = 0 ) : name( name ), labelled( labelled ) {}
+	Label( const std::string & name = "", Statement * labelled = 0, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : name( name ), labelled( labelled ), attributes( attributes ) {}
 	Label( const char * name, Statement * labelled = 0 ) : name( name ), labelled( labelled ) {}
 
Index: src/SynTree/ObjectDecl.cc
===================================================================
--- src/SynTree/ObjectDecl.cc	(revision 97065543cf1b9f9729488075aec62a4941f19f0d)
+++ src/SynTree/ObjectDecl.cc	(revision 71a3593146d24665b26d962ad83af645b8cb9505)
@@ -18,9 +18,10 @@
 #include "Initializer.h"
 #include "Expression.h"
+#include "Attribute.h"
 #include "Common/utility.h"
 #include "Statement.h"
 
-ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline, bool isNoreturn )
-	: Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
+ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
+	: Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
 	set_isInline( isInline );
 	set_isNoreturn( isNoreturn );
@@ -45,4 +46,6 @@
 		os << LinkageSpec::toString( get_linkage() ) << " ";
 	} // if
+
+	printAll( get_attributes(), os, indent );
 
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
@@ -80,4 +83,6 @@
 	} // if
 
+	// xxx - should printShort print attributes?
+
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
 		os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
