[index] Don't add relation to a NamedDecl with no name
authorBen Langmuir <blangmuir@apple.com>
Wed, 12 Jul 2017 22:05:30 +0000 (22:05 +0000)
committerBen Langmuir <blangmuir@apple.com>
Wed, 12 Jul 2017 22:05:30 +0000 (22:05 +0000)
commitda467ed444e5285008260f775022db5537ac3df4
tree9c2fd492c932d990bb242267c396765180942fa3
parent965613ef1b07ed44614ef93dc319f2c14170dff4
[index] Don't add relation to a NamedDecl with no name

Unless it's one of the special cases (tag, category) that we can handle.
This syncs up the check between handling a decl and handling a relation.

This would cause invalid nameless decls to end up in relations despite
having no name or USR.

rdar://problem/32474406

llvm-svn: 307855
clang/lib/Index/IndexingContext.cpp
clang/test/Index/Core/index-source-invalid-name.cpp [new file with mode: 0644]