Pull in r323998 from upstream clang trunk (by Richard Smith):
authordim <dim@FreeBSD.org>
Tue, 13 Feb 2018 17:05:50 +0000 (17:05 +0000)
committerdim <dim@FreeBSD.org>
Tue, 13 Feb 2018 17:05:50 +0000 (17:05 +0000)
commit248f9affc9fc18d3bb730a2c1a7d705224aff689
treefec1e85f0aa380dbebffdc2ced458d4b27bda1c9
parent4287266c4fbd0b1bc90cebe8170801d027305ef4
Pull in r323998 from upstream clang trunk (by Richard Smith):

  PR36157: When injecting an implicit function declaration in C89, find
  the right DeclContext rather than injecting it wherever we happen to
  be.

  This avoids creating functions whose DeclContext is a struct or
  similar.

This fixes assertion failures when parsing certain not-completely-valid
struct declarations.

Reported by: ae
PR: 225862
MFC after: 3 months
X-MFC-With: r327952
contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp