Generalize printing of nested-name-specifier sequences for use in both
QualifiedNameType and QualifiedDeclRefExpr. We now keep track of the
exact nested-name-specifier spelling for a QualifiedDeclRefExpr, and
use that spelling when printing ASTs. This fixes PR3493.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67283 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/qualified-names-print.cpp b/test/SemaCXX/qualified-names-print.cpp
new file mode 100644
index 0000000..9026552
--- /dev/null
+++ b/test/SemaCXX/qualified-names-print.cpp
@@ -0,0 +1,15 @@
+// RUN: clang -ast-print %s 2>&1 | grep "N::M::X<INT>::value"
+namespace N {
+  namespace M {
+    template<typename T>
+    struct X {
+      enum { value };
+    };
+  }
+}
+
+typedef int INT;
+
+int test() {
+  return N::M::X<INT>::value;
+}