diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-20 05:36:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-20 05:36:05 +0000 |
commit | 0a026af6deb4a9e9f30ff047e04db56eb4333741 (patch) | |
tree | 15a2851f52e9852208803fc32aca7604a72b4777 /test/Sema/exprs.c | |
parent | b54d8af9a66cc20a6a9a9219c7eaea8df7ee7fd4 (diff) | |
download | clang-0a026af6deb4a9e9f30ff047e04db56eb4333741.tar.gz |
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
Diffstat (limited to 'test/Sema/exprs.c')
-rw-r--r-- | test/Sema/exprs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c index 69a2320397..2bcc0f8a2c 100644 --- a/test/Sema/exprs.c +++ b/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')}} +} + + |