Index: src/Common/Debug.h
===================================================================
--- src/Common/Debug.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/Debug.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -28,23 +28,31 @@
 namespace Debug {
 	/// debug codegen a translation unit
-	static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {
+	static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) {
 	#ifdef DEBUG
 		std::list< Declaration * > decls;
 
-		filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), []( Declaration * decl ) {
-			return ! LinkageSpec::isBuiltin( decl->get_linkage() );
+		filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) {
+			return ! (decl->linkage & linkageFilter);
 		});
 
 		std::cerr << "======" << label << "======" << std::endl;
-		CodeGen::generate( decls, std::cerr, false, true );
+		CodeGen::generate(
+			decls,
+			std::cerr,
+			true /* doIntrinsics */,
+			true /* pretty */,
+			false /* generateC */,
+			false /* lineMarks */,
+			true /* printTypeExpr */
+		);
 	#endif
 	} // dump
 
-	static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {
+	static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) {
 	#ifdef DEBUG
 		std::list< Declaration * > decls;
 
-		filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), []( Declaration * decl ) {
-			return ! LinkageSpec::isBuiltin( decl->get_linkage() );
+		filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) {
+			return ! (decl->linkage & linkageFilter);
 		});
 
Index: src/Common/ErrorObjects.h
===================================================================
--- src/Common/ErrorObjects.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/ErrorObjects.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -35,5 +35,5 @@
 class SemanticErrorException : public std::exception {
   public:
-  	SemanticErrorException() = default;
+	SemanticErrorException() = default;
 	SemanticErrorException( CodeLocation location, std::string error );
 	~SemanticErrorException() throw() {}
Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/PassVisitor.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -66,4 +66,5 @@
 	virtual void visit( TypedefDecl * typeDecl ) override final;
 	virtual void visit( AsmDecl * asmDecl ) override final;
+	virtual void visit( StaticAssertDecl * assertDecl ) override final;
 
 	virtual void visit( CompoundStmt * compoundStmt ) override final;
@@ -91,4 +92,5 @@
 	virtual void visit( NameExpr * nameExpr ) override final;
 	virtual void visit( CastExpr * castExpr ) override final;
+	virtual void visit( KeywordCastExpr * castExpr ) override final;
 	virtual void visit( VirtualCastExpr * castExpr ) override final;
 	virtual void visit( AddressExpr * addressExpr ) override final;
@@ -163,4 +165,5 @@
 	virtual Declaration * mutate( TypedefDecl * typeDecl ) override final;
 	virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final;
+	virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) override final;
 
 	virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final;
@@ -187,7 +190,8 @@
 	virtual Expression * mutate( UntypedExpr * untypedExpr ) override final;
 	virtual Expression * mutate( NameExpr * nameExpr ) override final;
-	virtual Expression * mutate( AddressExpr * castExpr ) override final;
+	virtual Expression * mutate( AddressExpr * addrExpr ) override final;
 	virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final;
 	virtual Expression * mutate( CastExpr * castExpr ) override final;
+	virtual Expression * mutate( KeywordCastExpr * castExpr ) override final;
 	virtual Expression * mutate( VirtualCastExpr * castExpr ) override final;
 	virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final;
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/PassVisitor.impl.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -685,4 +685,26 @@
 
 //--------------------------------------------------------------------------
+// StaticAssertDecl
+template< typename pass_type >
+void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) {
+	VISIT_START( node );
+
+	maybeAccept_impl( node->condition, *this );
+	maybeAccept_impl( node->message  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) {
+	MUTATE_START( node );
+
+	maybeMutate_impl( node->condition, *this );
+	maybeMutate_impl( node->message  , *this );
+
+	MUTATE_END( StaticAssertDecl, node );
+}
+
+//--------------------------------------------------------------------------
 // CompoundStmt
 template< typename pass_type >
@@ -1238,4 +1260,27 @@
 
 //--------------------------------------------------------------------------
+// KeywordCastExpr
+template< typename pass_type >
+void PassVisitor< pass_type >::visit( KeywordCastExpr * node ) {
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept_impl        ( node->arg   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutate_impl   ( node->arg   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
 // VirtualCastExpr
 template< typename pass_type >
@@ -1491,5 +1536,4 @@
 	indexerScopedAccept( node->result, *this );
 	maybeAccept_impl   ( node->type  , *this );
-	maybeAccept_impl   ( node->member, *this );
 
 	VISIT_END( node );
@@ -1503,5 +1547,4 @@
 	indexerScopedMutate( node->result, *this );
 	maybeMutate_impl   ( node->type  , *this );
-	maybeMutate_impl   ( node->member, *this );
 
 	MUTATE_END( Expression, node );
Index: src/Common/SemanticError.cc
===================================================================
--- src/Common/SemanticError.cc	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/SemanticError.cc	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -68,10 +68,31 @@
 }
 
-void SemanticWarningImpl( CodeLocation location, Warning, const char * const fmt, ... ) {
-	va_list args;
-	va_start(args, fmt);
-	std::string msg = fmtToString( fmt, args );
-	va_end(args);
-	std::cerr << ErrorHelpers::bold() << location << ErrorHelpers::warning_str() << ErrorHelpers::reset_font() << msg << std::endl;
+void SemanticWarningImpl( CodeLocation location, Warning warning, const char * const fmt, ... ) {
+	Severity severity = WarningFormats[(int)warning].severity;
+	switch(severity) {
+	case Severity::Suppress :
+		break;
+	case Severity::Warn :
+		{
+			va_list args;
+			va_start(args, fmt);
+			std::string msg = fmtToString( fmt, args );
+			va_end(args);
+			std::cerr << ErrorHelpers::bold() << location << ErrorHelpers::warning_str() << ErrorHelpers::reset_font() << msg << std::endl;
+		}
+		break;
+	case Severity::Error :
+		{
+			va_list args;
+			va_start(args, fmt);
+			std::string msg = fmtToString( fmt, args );
+			va_end(args);
+			SemanticError(location, msg);
+		}
+		break;
+	case Severity::Critical :
+		assertf(false, "Critical errors not implemented yet");
+		break;
+	}
 }
 
Index: src/Common/SemanticError.h
===================================================================
--- src/Common/SemanticError.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/SemanticError.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Aug 29 22:03:36 2017
-// Update Count     : 17
+// Last Modified On : Thu Apr 19 17:52:03 2018
+// Update Count     : 19
 //
 
@@ -36,10 +36,27 @@
 // Warnings
 
-constexpr const char * const WarningFormats[] = {
-	"self assignment of expression: %s",
+enum class Severity {
+	Suppress,
+	Warn,
+	Error,
+	Critical
+};
+
+struct WarningData {
+	const char * const name;
+	const char * const message;
+	mutable Severity severity;
+};
+
+constexpr const WarningData WarningFormats[] = {
+	{"self-assign"         , "self assignment of expression: %s"           , Severity::Warn},
+	{"reference-conversion", "rvalue to reference conversion of rvalue: %s", Severity::Warn},
+	{"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn},
 };
 
 enum class Warning {
 	SelfAssignment,
+	RvalueToReferenceConversion,
+	BadQualifiersZeroOne,
 	NUMBER_OF_WARNINGS, //This MUST be the last warning
 };
@@ -50,5 +67,5 @@
 );
 
-#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], __VA_ARGS__)
+#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__)
 
 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 2efe4b8f0141e181a04fcc0495d13a8c7a0a06b9)
+++ src/Common/utility.h	(revision 1cdfa82ab4efb64ed6273f4e8e3993bc8895a419)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Thr Aug 17 11:38:00 2017
-// Update Count     : 34
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Apr 20 22:35:33 2018
+// Update Count     : 38
 //
 
@@ -433,4 +433,18 @@
 }
 
+// -----------------------------------------------------------------------------
+// O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most
+// significant bit (single instruction on x86)
+
+template<typename T>
+inline constexpr T ilog2(const T & t) {
+	if ( std::is_integral<T>::value ) {
+		const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1;
+		if ( sizeof(T) == sizeof(unsigned int ) ) return r - __builtin_clz( t );
+		if ( sizeof(T) == sizeof(unsigned long) ) return r - __builtin_clzl( t );
+		if ( sizeof(T) == sizeof(unsigned long long) ) return r - __builtin_clzll( t );
+	} // if
+	return -1;
+} // ilong2
 
 
