Skip to content

Commit e4c600f

Browse files
committed
[APINotes] ObjC classes cannot be nested in C++ namespaces
rdar://113403829
1 parent d3150b5 commit e4c600f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/APINotes/APINotesReader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,8 +1836,8 @@ auto APINotesReader::lookupObjCClassID(StringRef name) -> Optional<ContextID> {
18361836
if (!classID)
18371837
return None;
18381838

1839-
// TODO: Can ObjC classes be declared in C++ namespaces? If so, we should pass
1840-
// the parent context and use it instead of -1.
1839+
// ObjC classes can't be declared in C++ namespaces, so use -1 as the global
1840+
// context.
18411841
auto knownID = Impl.ObjCContextIDTable->find(
18421842
{-1, (uint8_t)ContextKind::ObjCClass, *classID});
18431843
if (knownID == Impl.ObjCContextIDTable->end())
@@ -1871,8 +1871,8 @@ auto APINotesReader::lookupObjCProtocolID(StringRef name)
18711871
if (!classID)
18721872
return None;
18731873

1874-
// TODO: Can ObjC classes be declared in C++ namespaces? If so, we should pass
1875-
// the parent context and use it instead of -1.
1874+
// ObjC classes can't be declared in C++ namespaces, so use -1 as the global
1875+
// context.
18761876
auto knownID = Impl.ObjCContextIDTable->find(
18771877
{-1, (uint8_t)ContextKind::ObjCProtocol, *classID});
18781878
if (knownID == Impl.ObjCContextIDTable->end())

0 commit comments

Comments
 (0)