Fix violations of [basic.class.scope]p2.
authorRichard Smith <richard@metafoo.co.uk>
Tue, 2 Jun 2020 04:10:27 +0000 (21:10 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 2 Jun 2020 05:03:05 +0000 (22:03 -0700)
commit4ccb6c36a9159809f4b98176325ae202753fe136
tree47909c5b45336da9da6d7cf0a5a46d944f87a454
parente51d5bc7a4fc967c8a99a75cfa9480eb6b3a4fae
Fix violations of [basic.class.scope]p2.

These cases all follow the same pattern:

struct A {
  friend class X;
  //...
  class X {};
};

But 'friend class X;' injects 'X' into the surrounding namespace scope,
rather than introducing a class member. So the second 'class X {}' is a
completely different type, which changes the meaning of the earlier name
'X' from '::X' to 'A::X'.

Additionally, the friend declaration is pointless -- members of a class
don't need to be befriended to be able to access private members.
clang/lib/Analysis/CFG.cpp
clang/utils/TableGen/NeonEmitter.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/CodeGen/InterferenceCache.h