Index: src/SynTree/AggregateDecl.cc
===================================================================
--- src/SynTree/AggregateDecl.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/AggregateDecl.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 23:56:39 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:31:47 2017
-// Update Count     : 19
+// Last Modified On : Thu Mar 16 07:49:07 2017
+// Update Count     : 20
 //
 
@@ -20,5 +20,5 @@
 
 
-AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name, DeclarationNode::StorageClasses(), LinkageSpec::Cforall ), body( false ), attributes( attributes ) {
+AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name, Type::StorageClasses(), LinkageSpec::Cforall ), body( false ), attributes( attributes ) {
 }
 
Index: src/SynTree/Declaration.cc
===================================================================
--- src/SynTree/Declaration.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/Declaration.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:31:11 2017
-// Update Count     : 23
+// Last Modified On : Thu Mar 16 07:49:18 2017
+// Update Count     : 24
 //
 
@@ -27,5 +27,5 @@
 static IdMapType idMap;
 
-Declaration::Declaration( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage )
+Declaration::Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage )
 		: name( name ), storageClasses( scs ), linkage( linkage ), uniqueId( 0 ) {
 }
@@ -66,5 +66,5 @@
 
 
-AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", DeclarationNode::StorageClasses(), LinkageSpec::C ), stmt( stmt ) {
+AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) {
 }
 
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/Declaration.h	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:40:42 2017
-// Update Count     : 113
+// Last Modified On : Thu Mar 16 07:48:23 2017
+// Update Count     : 117
 //
 
@@ -28,5 +28,5 @@
 class Declaration : public BaseSyntaxNode {
   public:
-	Declaration( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage );
+	Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
 	Declaration( const Declaration &other );
 	virtual ~Declaration();
@@ -35,5 +35,5 @@
 	void set_name( std::string newValue ) { name = newValue; }
 
-	DeclarationNode::StorageClasses get_storageClasses() const { return storageClasses; }
+	Type::StorageClasses get_storageClasses() const { return storageClasses; }
 
 	LinkageSpec::Spec get_linkage() const { return linkage; }
@@ -56,5 +56,5 @@
   private:
 	std::string name;
-	DeclarationNode::StorageClasses storageClasses;
+	Type::StorageClasses storageClasses;
 	LinkageSpec::Spec linkage;
 	UniqueId uniqueId;
@@ -64,5 +64,5 @@
 class DeclarationWithType : public Declaration {
   public:
-	DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs );
+	DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs );
 	DeclarationWithType( const DeclarationWithType &other );
 	virtual ~DeclarationWithType();
@@ -104,5 +104,5 @@
 	typedef DeclarationWithType Parent;
   public:
-	ObjectDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,
+	ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,
 				const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpecifiers fs = DeclarationNode::FuncSpecifiers() );
 	ObjectDecl( const ObjectDecl &other );
@@ -132,5 +132,5 @@
 	typedef DeclarationWithType Parent;
   public:
-	FunctionDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
+	FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
 				  const std::list< Attribute * > attributes = std::list< Attribute * >(), DeclarationNode::FuncSpecifiers fs = DeclarationNode::FuncSpecifiers() );
 	FunctionDecl( const FunctionDecl &other );
@@ -158,5 +158,5 @@
 	typedef Declaration Parent;
   public:
-	NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type );
+	NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type );
 	NamedTypeDecl( const NamedTypeDecl &other );
 	virtual ~NamedTypeDecl();
@@ -193,5 +193,5 @@
 	};
 
-	TypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type, Kind kind );
+	TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind );
 	TypeDecl( const TypeDecl &other );
 
@@ -214,5 +214,5 @@
 	typedef NamedTypeDecl Parent;
   public:
-	TypedefDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type ) : Parent( name, scs, type ) {}
+	TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type ) : Parent( name, scs, type ) {}
 	TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
 
Index: src/SynTree/DeclarationWithType.cc
===================================================================
--- src/SynTree/DeclarationWithType.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/DeclarationWithType.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:32:14 2017
-// Update Count     : 23
+// Last Modified On : Thu Mar 16 07:49:27 2017
+// Update Count     : 24
 //
 
@@ -19,5 +19,5 @@
 #include "Common/utility.h"
 
-DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs )
+DeclarationWithType::DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, DeclarationNode::FuncSpecifiers fs )
 	: Declaration( name, scs, linkage ), asmName( nullptr ), attributes( attributes ), fs( fs ) {
 }
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/FunctionDecl.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar 15 23:33:43 2017
-// Update Count     : 72
+// Last Modified On : Thu Mar 16 07:49:35 2017
+// Update Count     : 73
 //
 
@@ -26,5 +26,5 @@
 extern bool translation_unit_nomain;
 
-FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs )
+FunctionDecl::FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs )
 	: Parent( name, scs, linkage, attributes, fs ), type( type ), statements( statements ) {
 	// hack forcing the function "main" to have Cforall linkage to replace main even if it is inside an extern
Index: src/SynTree/NamedTypeDecl.cc
===================================================================
--- src/SynTree/NamedTypeDecl.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/NamedTypeDecl.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar 15 23:25:41 2017
-// Update Count     : 12
+// Last Modified On : Thu Mar 16 07:49:44 2017
+// Update Count     : 13
 //
 
@@ -18,5 +18,5 @@
 #include "Common/utility.h"
 
-NamedTypeDecl::NamedTypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *base )
+NamedTypeDecl::NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *base )
 	: Parent( name, scs, LinkageSpec::Cforall ), base( base ) {}
 
Index: src/SynTree/ObjectDecl.cc
===================================================================
--- src/SynTree/ObjectDecl.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/ObjectDecl.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar 15 23:26:22 2017
-// Update Count     : 57
+// Last Modified On : Thu Mar 16 07:49:51 2017
+// Update Count     : 58
 //
 
@@ -22,5 +22,5 @@
 #include "Statement.h"
 
-ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs )
+ObjectDecl::ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs )
 	: Parent( name, scs, linkage, attributes, fs ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
 }
Index: src/SynTree/Type.cc
===================================================================
--- src/SynTree/Type.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/Type.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar 15 23:14:35 2017
-// Update Count     : 19
+// Last Modified On : Thu Mar 16 07:57:45 2017
+// Update Count     : 20
 //
 
@@ -59,4 +59,6 @@
 }
 
+// These must remain in the same order as the corresponding bit fields.
+const char * Type::StorageClasses::Names[] = { "extern", "static", "auto", "register", "_Thread_local" };
 const char * Type::Qualifiers::Names[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
 
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/Type.h	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar 15 23:28:33 2017
-// Update Count     : 89
+// Last Modified On : Thu Mar 16 07:45:29 2017
+// Update Count     : 90
 //
 
@@ -24,4 +24,33 @@
 class Type : public BaseSyntaxNode {
   public:
+	// enum must remain in the same order as the corresponding bit fields.
+
+	enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NumStorageClass = 5 };
+	union StorageClasses {
+		static const char * Names[];
+		unsigned int val;
+		struct {
+			bool is_extern : 1;
+			bool is_static : 1;
+			bool is_auto : 1;
+			bool is_register : 1;
+			bool is_threadlocal : 1;
+		};
+
+		StorageClasses() : val( 0 ) {}
+		StorageClasses( unsigned int val ) : val( val ) {}
+		bool operator[]( unsigned int i ) const { return val & (1 << i); }
+		bool any() const { return val != 0; }
+		void print( std::ostream & os ) const {
+			if ( (*this).any() ) {						// any storage classes ?
+				for ( unsigned int i = 0; i < NumStorageClass; i += 1 ) {
+					if ( (*this)[i] ) {
+						os << StorageClasses::Names[i] << ' ';
+					} // if
+				} // for
+			} // if
+		}
+	}; // StorageClasses
+
 	enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6 };
 	union Qualifiers {
Index: src/SynTree/TypeDecl.cc
===================================================================
--- src/SynTree/TypeDecl.cc	(revision 6e8bd434e6c282eabe8c3f0bd2232d54731d7adf)
+++ src/SynTree/TypeDecl.cc	(revision 68fe077a5764a46debddf5a5dc89ef3614748ccd)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar  7 07:39:09 2017
-// Update Count     : 4
+// Last Modified On : Thu Mar 16 07:49:58 2017
+// Update Count     : 5
 //
 
@@ -18,5 +18,5 @@
 #include "Common/utility.h"
 
-TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClasses scs, Type *type, Kind kind ) : Parent( name, scs, type ), kind( kind ), sized( kind == Any || kind == Ttype ) {
+TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind ) : Parent( name, scs, type ), kind( kind ), sized( kind == Any || kind == Ttype ) {
 }
 
