From: Douglas Gregor Date: Sat, 2 Oct 2010 21:06:43 +0000 (+0000) Subject: When we insert a category (or class extension) into an interface, mark X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e9888c2786bfffa6879a08ff40f5a11545eec23;p=clang When we insert a category (or class extension) into an interface, mark the interface as having changed since it was originally serialized. This ensures that we see class extensions/categories in chained PCH files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115421 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index ad26748e13..5dde92eb0b 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -991,6 +991,7 @@ public: void insertNextClassCategory() { NextClassCategory = ClassInterface->getCategoryList(); ClassInterface->setCategoryList(this); + ClassInterface->setChangedSinceDeserialization(true); } bool IsClassExtension() const { return getIdentifier() == 0; } diff --git a/test/PCH/Inputs/chain-selectors1.h b/test/PCH/Inputs/chain-selectors1.h index 37c1c00b57..b0b68f8332 100644 --- a/test/PCH/Inputs/chain-selectors1.h +++ b/test/PCH/Inputs/chain-selectors1.h @@ -10,3 +10,7 @@ void foo1() { //(void)@selector(x); (void)@selector(f); } + +@interface X (Blah) +- (void)blah_method; +@end diff --git a/test/PCH/Inputs/chain-selectors2.h b/test/PCH/Inputs/chain-selectors2.h index 4d6b556630..973fc107e9 100644 --- a/test/PCH/Inputs/chain-selectors2.h +++ b/test/PCH/Inputs/chain-selectors2.h @@ -9,3 +9,7 @@ void foo2() { //(void)@selector(y); //(void)@selector(e); } + +@interface X (Blarg) +- (void)blarg_method; +@end diff --git a/test/PCH/chain-selectors.m b/test/PCH/chain-selectors.m index 60db3f994b..3b19172799 100644 --- a/test/PCH/chain-selectors.m +++ b/test/PCH/chain-selectors.m @@ -22,3 +22,19 @@ void bar() { (void)@selector(y); // expected-warning {{unimplemented selector}} (void)@selector(e); // expected-warning {{unimplemented selector}} } + +@implementation X (Blah) +- (void)test_Blah { + [self blah_method]; +} + +- (void)blah_method { } +@end + +@implementation X (Blarg) +- (void)test_Blarg { + [self blarg_method]; +} + +- (void)blarg_method { } +@end