Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision 6d51bd7cd93d2958aac506ca3e6ef1f91b13168b)
+++ src/AST/Pass.hpp	(revision 23f99e1d5411939dbd45a0bbb1412b814c387ffa)
@@ -85,98 +85,98 @@
 
 	/// Visit function declarations
-	virtual const ast::DeclWithType *     visit( const ast::ObjectDecl           * ) override final;
-	virtual const ast::DeclWithType *     visit( const ast::FunctionDecl         * ) override final;
-	virtual const ast::Decl *             visit( const ast::StructDecl           * ) override final;
-	virtual const ast::Decl *             visit( const ast::UnionDecl            * ) override final;
-	virtual const ast::Decl *             visit( const ast::EnumDecl             * ) override final;
-	virtual const ast::Decl *             visit( const ast::TraitDecl            * ) override final;
-	virtual const ast::Decl *             visit( const ast::TypeDecl             * ) override final;
-	virtual const ast::Decl *             visit( const ast::TypedefDecl          * ) override final;
-	virtual const ast::AsmDecl *          visit( const ast::AsmDecl              * ) override final;
-	virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl     * ) override final;
-	virtual const ast::CompoundStmt *     visit( const ast::CompoundStmt         * ) override final;
-	virtual const ast::Stmt *             visit( const ast::ExprStmt             * ) override final;
-	virtual const ast::Stmt *             visit( const ast::AsmStmt              * ) override final;
-	virtual const ast::Stmt *             visit( const ast::DirectiveStmt        * ) override final;
-	virtual const ast::Stmt *             visit( const ast::IfStmt               * ) override final;
-	virtual const ast::Stmt *             visit( const ast::WhileStmt            * ) override final;
-	virtual const ast::Stmt *             visit( const ast::ForStmt              * ) override final;
-	virtual const ast::Stmt *             visit( const ast::SwitchStmt           * ) override final;
-	virtual const ast::Stmt *             visit( const ast::CaseStmt             * ) override final;
-	virtual const ast::Stmt *             visit( const ast::BranchStmt           * ) override final;
-	virtual const ast::Stmt *             visit( const ast::ReturnStmt           * ) override final;
-	virtual const ast::Stmt *             visit( const ast::ThrowStmt            * ) override final;
-	virtual const ast::Stmt *             visit( const ast::TryStmt              * ) override final;
-	virtual const ast::Stmt *             visit( const ast::CatchStmt            * ) override final;
-	virtual const ast::Stmt *             visit( const ast::FinallyStmt          * ) override final;
-	virtual const ast::Stmt *             visit( const ast::WaitForStmt          * ) override final;
-	virtual const ast::Stmt *             visit( const ast::WithStmt             * ) override final;
-	virtual const ast::NullStmt *         visit( const ast::NullStmt             * ) override final;
-	virtual const ast::Stmt *             visit( const ast::DeclStmt             * ) override final;
-	virtual const ast::Stmt *             visit( const ast::ImplicitCtorDtorStmt * ) override final;
-	virtual const ast::Expr *             visit( const ast::ApplicationExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::UntypedExpr          * ) override final;
-	virtual const ast::Expr *             visit( const ast::NameExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::AddressExpr          * ) override final;
-	virtual const ast::Expr *             visit( const ast::LabelAddressExpr     * ) override final;
-	virtual const ast::Expr *             visit( const ast::CastExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::KeywordCastExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::VirtualCastExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::UntypedMemberExpr    * ) override final;
-	virtual const ast::Expr *             visit( const ast::MemberExpr           * ) override final;
-	virtual const ast::Expr *             visit( const ast::VariableExpr         * ) override final;
-	virtual const ast::Expr *             visit( const ast::ConstantExpr         * ) override final;
-	virtual const ast::Expr *             visit( const ast::SizeofExpr           * ) override final;
-	virtual const ast::Expr *             visit( const ast::AlignofExpr          * ) override final;
-	virtual const ast::Expr *             visit( const ast::UntypedOffsetofExpr  * ) override final;
-	virtual const ast::Expr *             visit( const ast::OffsetofExpr         * ) override final;
-	virtual const ast::Expr *             visit( const ast::OffsetPackExpr       * ) override final;
-	virtual const ast::Expr *             visit( const ast::AttrExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::LogicalExpr          * ) override final;
-	virtual const ast::Expr *             visit( const ast::ConditionalExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::CommaExpr            * ) override final;
-	virtual const ast::Expr *             visit( const ast::TypeExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::AsmExpr              * ) override final;
-	virtual const ast::Expr *             visit( const ast::ImplicitCopyCtorExpr * ) override final;
-	virtual const ast::Expr *             visit( const ast::ConstructorExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::CompoundLiteralExpr  * ) override final;
-	virtual const ast::Expr *             visit( const ast::RangeExpr            * ) override final;
-	virtual const ast::Expr *             visit( const ast::UntypedTupleExpr     * ) override final;
-	virtual const ast::Expr *             visit( const ast::TupleExpr            * ) override final;
-	virtual const ast::Expr *             visit( const ast::TupleIndexExpr       * ) override final;
-	virtual const ast::Expr *             visit( const ast::TupleAssignExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::StmtExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::UniqueExpr           * ) override final;
-	virtual const ast::Expr *             visit( const ast::UntypedInitExpr      * ) override final;
-	virtual const ast::Expr *             visit( const ast::InitExpr             * ) override final;
-	virtual const ast::Expr *             visit( const ast::DeletedExpr          * ) override final;
-	virtual const ast::Expr *             visit( const ast::DefaultArgExpr       * ) override final;
-	virtual const ast::Expr *             visit( const ast::GenericExpr          * ) override final;
-	virtual const ast::Type *             visit( const ast::VoidType             * ) override final;
-	virtual const ast::Type *             visit( const ast::BasicType            * ) override final;
-	virtual const ast::Type *             visit( const ast::PointerType          * ) override final;
-	virtual const ast::Type *             visit( const ast::ArrayType            * ) override final;
-	virtual const ast::Type *             visit( const ast::ReferenceType        * ) override final;
-	virtual const ast::Type *             visit( const ast::QualifiedType        * ) override final;
-	virtual const ast::Type *             visit( const ast::FunctionType         * ) override final;
-	virtual const ast::Type *             visit( const ast::StructInstType       * ) override final;
-	virtual const ast::Type *             visit( const ast::UnionInstType        * ) override final;
-	virtual const ast::Type *             visit( const ast::EnumInstType         * ) override final;
-	virtual const ast::Type *             visit( const ast::TraitInstType        * ) override final;
-	virtual const ast::Type *             visit( const ast::TypeInstType         * ) override final;
-	virtual const ast::Type *             visit( const ast::TupleType            * ) override final;
-	virtual const ast::Type *             visit( const ast::TypeofType           * ) override final;
-	virtual const ast::Type *             visit( const ast::AttrType             * ) override final;
-	virtual const ast::Type *             visit( const ast::VarArgsType          * ) override final;
-	virtual const ast::Type *             visit( const ast::ZeroType             * ) override final;
-	virtual const ast::Type *             visit( const ast::OneType              * ) override final;
-	virtual const ast::Type *             visit( const ast::GlobalScopeType      * ) override final;
-	virtual const ast::Designation *      visit( const ast::Designation          * ) override final;
-	virtual const ast::Init *             visit( const ast::SingleInit           * ) override final;
-	virtual const ast::Init *             visit( const ast::ListInit             * ) override final;
-	virtual const ast::Init *             visit( const ast::ConstructorInit      * ) override final;
-	virtual const ast::Constant *         visit( const ast::Constant             * ) override final;
-	virtual const ast::Attribute *        visit( const ast::Attribute            * ) override final;
-	virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution     * ) override final;
+	const ast::DeclWithType *     visit( const ast::ObjectDecl           * ) override final;
+	const ast::DeclWithType *     visit( const ast::FunctionDecl         * ) override final;
+	const ast::Decl *             visit( const ast::StructDecl           * ) override final;
+	const ast::Decl *             visit( const ast::UnionDecl            * ) override final;
+	const ast::Decl *             visit( const ast::EnumDecl             * ) override final;
+	const ast::Decl *             visit( const ast::TraitDecl            * ) override final;
+	const ast::Decl *             visit( const ast::TypeDecl             * ) override final;
+	const ast::Decl *             visit( const ast::TypedefDecl          * ) override final;
+	const ast::AsmDecl *          visit( const ast::AsmDecl              * ) override final;
+	const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl     * ) override final;
+	const ast::CompoundStmt *     visit( const ast::CompoundStmt         * ) override final;
+	const ast::Stmt *             visit( const ast::ExprStmt             * ) override final;
+	const ast::Stmt *             visit( const ast::AsmStmt              * ) override final;
+	const ast::Stmt *             visit( const ast::DirectiveStmt        * ) override final;
+	const ast::Stmt *             visit( const ast::IfStmt               * ) override final;
+	const ast::Stmt *             visit( const ast::WhileStmt            * ) override final;
+	const ast::Stmt *             visit( const ast::ForStmt              * ) override final;
+	const ast::Stmt *             visit( const ast::SwitchStmt           * ) override final;
+	const ast::Stmt *             visit( const ast::CaseStmt             * ) override final;
+	const ast::Stmt *             visit( const ast::BranchStmt           * ) override final;
+	const ast::Stmt *             visit( const ast::ReturnStmt           * ) override final;
+	const ast::Stmt *             visit( const ast::ThrowStmt            * ) override final;
+	const ast::Stmt *             visit( const ast::TryStmt              * ) override final;
+	const ast::Stmt *             visit( const ast::CatchStmt            * ) override final;
+	const ast::Stmt *             visit( const ast::FinallyStmt          * ) override final;
+	const ast::Stmt *             visit( const ast::WaitForStmt          * ) override final;
+	const ast::Stmt *             visit( const ast::WithStmt             * ) override final;
+	const ast::NullStmt *         visit( const ast::NullStmt             * ) override final;
+	const ast::Stmt *             visit( const ast::DeclStmt             * ) override final;
+	const ast::Stmt *             visit( const ast::ImplicitCtorDtorStmt * ) override final;
+	const ast::Expr *             visit( const ast::ApplicationExpr      * ) override final;
+	const ast::Expr *             visit( const ast::UntypedExpr          * ) override final;
+	const ast::Expr *             visit( const ast::NameExpr             * ) override final;
+	const ast::Expr *             visit( const ast::AddressExpr          * ) override final;
+	const ast::Expr *             visit( const ast::LabelAddressExpr     * ) override final;
+	const ast::Expr *             visit( const ast::CastExpr             * ) override final;
+	const ast::Expr *             visit( const ast::KeywordCastExpr      * ) override final;
+	const ast::Expr *             visit( const ast::VirtualCastExpr      * ) override final;
+	const ast::Expr *             visit( const ast::UntypedMemberExpr    * ) override final;
+	const ast::Expr *             visit( const ast::MemberExpr           * ) override final;
+	const ast::Expr *             visit( const ast::VariableExpr         * ) override final;
+	const ast::Expr *             visit( const ast::ConstantExpr         * ) override final;
+	const ast::Expr *             visit( const ast::SizeofExpr           * ) override final;
+	const ast::Expr *             visit( const ast::AlignofExpr          * ) override final;
+	const ast::Expr *             visit( const ast::UntypedOffsetofExpr  * ) override final;
+	const ast::Expr *             visit( const ast::OffsetofExpr         * ) override final;
+	const ast::Expr *             visit( const ast::OffsetPackExpr       * ) override final;
+	const ast::Expr *             visit( const ast::AttrExpr             * ) override final;
+	const ast::Expr *             visit( const ast::LogicalExpr          * ) override final;
+	const ast::Expr *             visit( const ast::ConditionalExpr      * ) override final;
+	const ast::Expr *             visit( const ast::CommaExpr            * ) override final;
+	const ast::Expr *             visit( const ast::TypeExpr             * ) override final;
+	const ast::Expr *             visit( const ast::AsmExpr              * ) override final;
+	const ast::Expr *             visit( const ast::ImplicitCopyCtorExpr * ) override final;
+	const ast::Expr *             visit( const ast::ConstructorExpr      * ) override final;
+	const ast::Expr *             visit( const ast::CompoundLiteralExpr  * ) override final;
+	const ast::Expr *             visit( const ast::RangeExpr            * ) override final;
+	const ast::Expr *             visit( const ast::UntypedTupleExpr     * ) override final;
+	const ast::Expr *             visit( const ast::TupleExpr            * ) override final;
+	const ast::Expr *             visit( const ast::TupleIndexExpr       * ) override final;
+	const ast::Expr *             visit( const ast::TupleAssignExpr      * ) override final;
+	const ast::Expr *             visit( const ast::StmtExpr             * ) override final;
+	const ast::Expr *             visit( const ast::UniqueExpr           * ) override final;
+	const ast::Expr *             visit( const ast::UntypedInitExpr      * ) override final;
+	const ast::Expr *             visit( const ast::InitExpr             * ) override final;
+	const ast::Expr *             visit( const ast::DeletedExpr          * ) override final;
+	const ast::Expr *             visit( const ast::DefaultArgExpr       * ) override final;
+	const ast::Expr *             visit( const ast::GenericExpr          * ) override final;
+	const ast::Type *             visit( const ast::VoidType             * ) override final;
+	const ast::Type *             visit( const ast::BasicType            * ) override final;
+	const ast::Type *             visit( const ast::PointerType          * ) override final;
+	const ast::Type *             visit( const ast::ArrayType            * ) override final;
+	const ast::Type *             visit( const ast::ReferenceType        * ) override final;
+	const ast::Type *             visit( const ast::QualifiedType        * ) override final;
+	const ast::Type *             visit( const ast::FunctionType         * ) override final;
+	const ast::Type *             visit( const ast::StructInstType       * ) override final;
+	const ast::Type *             visit( const ast::UnionInstType        * ) override final;
+	const ast::Type *             visit( const ast::EnumInstType         * ) override final;
+	const ast::Type *             visit( const ast::TraitInstType        * ) override final;
+	const ast::Type *             visit( const ast::TypeInstType         * ) override final;
+	const ast::Type *             visit( const ast::TupleType            * ) override final;
+	const ast::Type *             visit( const ast::TypeofType           * ) override final;
+	const ast::Type *             visit( const ast::AttrType             * ) override final;
+	const ast::Type *             visit( const ast::VarArgsType          * ) override final;
+	const ast::Type *             visit( const ast::ZeroType             * ) override final;
+	const ast::Type *             visit( const ast::OneType              * ) override final;
+	const ast::Type *             visit( const ast::GlobalScopeType      * ) override final;
+	const ast::Designation *      visit( const ast::Designation          * ) override final;
+	const ast::Init *             visit( const ast::SingleInit           * ) override final;
+	const ast::Init *             visit( const ast::ListInit             * ) override final;
+	const ast::Init *             visit( const ast::ConstructorInit      * ) override final;
+	const ast::Constant *         visit( const ast::Constant             * ) override final;
+	const ast::Attribute *        visit( const ast::Attribute            * ) override final;
+	const ast::TypeSubstitution * visit( const ast::TypeSubstitution     * ) override final;
 
 	friend void acceptAll( std::list< ptr<Decl> > & decls, Pass<pass_t>& visitor );
@@ -216,4 +216,7 @@
 		Pass<pass_t> & pass;
 	};
+
+private:
+	bool inFunction = false;
 };
 
