diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 8204e3509dd56..a65dc85e04a83 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1738,13 +1738,12 @@ void NamedDecl::printNestedNameSpecifier(raw_ostream &OS, // Suppress inline namespace if it doesn't make the result ambiguous. if (Ctx->isInlineNamespace() && NameInScope) { - bool isRedundant = - cast(Ctx)->isRedundantInlineQualifierFor(NameInScope); if (P.SuppressInlineNamespace == PrintingPolicy::SuppressInlineNamespaceMode::All || (P.SuppressInlineNamespace == PrintingPolicy::SuppressInlineNamespaceMode::Redundant && - isRedundant)) { + cast(Ctx)->isRedundantInlineQualifierFor( + NameInScope))) { continue; } }