diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2008-02-06 04:53:22 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2008-02-06 04:53:22 +0000 |
| commit | d49a720d527527a96302b00d2c4726af7d9dc7c1 (patch) | |
| tree | cc053d22d21c7d84364a875281592d379a4e48ed /clang/test/Sema/compare.c | |
| parent | a5e4d30942a5489d8889c58f420f3fa48f6a468d (diff) | |
| download | bcm5719-llvm-d49a720d527527a96302b00d2c4726af7d9dc7c1.tar.gz bcm5719-llvm-d49a720d527527a96302b00d2c4726af7d9dc7c1.zip | |
Be a bit stricter about array type compatibility.
llvm-svn: 46799
Diffstat (limited to 'clang/test/Sema/compare.c')
| -rw-r--r-- | clang/test/Sema/compare.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/Sema/compare.c b/clang/test/Sema/compare.c index 25d7a9169b9..e1ebf575ac6 100644 --- a/clang/test/Sema/compare.c +++ b/clang/test/Sema/compare.c @@ -1,4 +1,4 @@ -// RUN: clang -fsyntax-only -verify %s +// RUN: clang -fsyntax-only -pedantic -verify %s int test(char *C) { // nothing here should warn. return C != ((void*)0); @@ -10,3 +10,8 @@ int equal(char *a, const char *b) { return a == b; } + +int arrays(char (*a)[5], char(*b)[10], char(*c)[5]) { + int d = (a == c); + return a == b; // expected-warning {{comparison of distinct pointer types}} +} |

