This patch makes NamedDecl::printQualifiedName more like TypePrinter::AppendScope. I.e. it ignores anonymous and inline namespaces if PrintingPolicy::SuppressUnwrittenScope is true.
The actual change is simple and small. I have doubts about the added test. Don't know if it should be a unit test or a lit test. I've created unit test AST/NamedDeclPrinterTest.cpp based on AST/DeclPrinterTest.cpp and AST/StmtPrinterTest.cpp. I'll be glad to rework test to a more appropriate shape.
I've added Douglas Gregor as a reviewer because he has introduced SuppressUnwrittenScope flag in r143599. If it's a wrong decision, please, direct me to the right person.
Corresponding discussion on cfe-def mailing list can be found at http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-May/037029.html
Just use isInline here since you already know you've got a namespace.