]> granicus.if.org Git - clang/commit
PR34822: Fix a collection of related bugs with our handling of C89 implicit function...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Oct 2017 01:49:22 +0000 (01:49 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Oct 2017 01:49:22 +0000 (01:49 +0000)
commit37e876e3dbbb18d37d8824f2d1fee87072e3764c
tree2097261683dd4c374e46390304f611d96590d7a2
parent15b35a3943d2743eea7908bf3eede18cbee4d7b0
PR34822: Fix a collection of related bugs with our handling of C89 implicit function declarations.

We were injecting the function into the wrong semantic context, resulting in it
failing to be registered as a global for redeclaration lookup. As a
consequence, we accepted invalid code since r310616.

Fixing that resulted in the "out-of-scope declaration" diagnostic firing a lot
more often. It turned out that warning codepath was non-conforming, because it
did not cause us to inject the implicitly-declared function into the enclosing
block scope. We now only warn if the type of the out-of-scope declaration
doesn't match the type of an implicitly-declared function; in all other cases,
we produce the normal warning for an implicitly-declared function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314871 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/Misc/warning-flags.c
test/Sema/implicit-decl-c90.c
test/Sema/implicit-decl.c