]> granicus.if.org Git - clang/commit
When declaring an ObjC interface decl with a @compatibility_alias alias name, change...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 18 Jun 2013 21:26:33 +0000 (21:26 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 18 Jun 2013 21:26:33 +0000 (21:26 +0000)
commite7e8fcacef233f35ad7e81083f7edd12497f6c40
tree3826dd0fd12ab61b40a4431f641adb6852b9430d
parentda1f9cb8ce0e89d2848390aef985bad9e32e1ddb
When declaring an ObjC interface decl with a @compatibility_alias alias name, change the class name to the "real" one.

If we have something like

  @class NewImage;
  @compatibility_alias OldImage NewImage;
  @class OldImage;

the lookup for 'OldImage' will return the 'NewImage' decl ("@class NewImage").
In such a case, when creating the decl for "@class OldImage" use the real declaration name ("NewImage"),
instead of the alias one ("OldImage"), otherwise we will break IdentifierResolver and redecls-chain invariants.

Fixes crash of rdar://14112291.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184238 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclObjC.cpp
test/PCH/objc_import.h
test/PCH/objc_import.m