added special treatment for nested function for clang