summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-20 05:36:05 +0000
committerChris Lattner <sabre@nondot.org>2009-10-20 05:36:05 +0000
commitbd19b181008ebc1cdcec396d06fac96a0f28ffea (patch)
tree87090d0e16dbc1f2c797c474a28ece42c95f6f77 /clang/test
parent7e858573a8bb2f4fdf2207832607234ab1e21b5e (diff)
downloadbcm5719-llvm-bd19b181008ebc1cdcec396d06fac96a0f28ffea.tar.gz
bcm5719-llvm-bd19b181008ebc1cdcec396d06fac96a0f28ffea.zip
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. llvm-svn: 84604
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/exprs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index 69a2320397f..2bcc0f8a2ca 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -103,3 +103,12 @@ void test14() {
__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')}}
+}
+
+
OpenPOWER on IntegriCloud