diff options
author | Steve Naroff <snaroff@apple.com> | 2008-08-09 16:04:40 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-08-09 16:04:40 +0000 |
commit | 239255d2a6f0c568450aff21c09a4eb91ad10bef (patch) | |
tree | 23cd3335d6ba95526e3977729e805de0b2cfc187 /clang/test/Sema/tentative-decls.c | |
parent | 059588a1ee2551d195eaed77edfb8f9c5f268d44 (diff) | |
download | bcm5719-llvm-239255d2a6f0c568450aff21c09a4eb91ad10bef.tar.gz bcm5719-llvm-239255d2a6f0c568450aff21c09a4eb91ad10bef.zip |
Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.
Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.
llvm-svn: 54583
Diffstat (limited to 'clang/test/Sema/tentative-decls.c')
-rw-r--r-- | clang/test/Sema/tentative-decls.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Sema/tentative-decls.c b/clang/test/Sema/tentative-decls.c index 64f3809e19f..7a374e05533 100644 --- a/clang/test/Sema/tentative-decls.c +++ b/clang/test/Sema/tentative-decls.c @@ -24,6 +24,9 @@ int i4; int i4; extern int i4; +int (*pToArray)[]; +int (*pToArray)[8]; + void func() { extern int i1; // expected-error{{previous definition is here}} static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} |