Implement PR5242: don't desugar a type more than once in a diagnostic.  This
implements a framework that allows us to use information about previously
substituted values to simplify subsequent ones.  Maybe this would be useful
for C++'y stuff, who knows.  We now get:

t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
  return (size_t) 0 + (size_t) 0;
         ~~~~~~~~~~ ^ ~~~~~~~~~~

on the testcase.  Note that size_t is only aka'd once.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84604 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c
index 69a2320..2bcc0f8 100644
--- a/test/Sema/exprs.c
+++ b/test/Sema/exprs.c
@@ -103,3 +103,12 @@
   __m64 mask = (__m64)((__v4hi)a > (__v4hi)a);
 }
 
+
+// PR5242
+typedef unsigned long *test15_t;
+
+test15_t test15(void) {
+  return (test15_t)0 + (test15_t)0;  // expected-error {{invalid operands to binary expression ('test15_t' (aka 'unsigned long *') and 'test15_t')}}
+}
+
+