[AST] Fix the PrintQualifiedName for ObjC instance variable in class extension.
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 19 May 2020 13:10:10 +0000 (15:10 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 19 May 2020 13:17:36 +0000 (15:17 +0200)
commit6f56599c14af0a4b7a4d4b2c4f6ae44bc2754c0c
tree8b30998e952d78b3ddc71f6a8a1597e374852144
parente984b7f2a232cb799d6cf1e2f75a3162eca1267c
[AST] Fix the PrintQualifiedName for ObjC instance variable in class extension.

Summary:
Similar to property, we print the containing interface decl as the
nested name specifier for ivar; otherwise we will get "::ivar_name".

this would fix an assertion crash in clangd: https://github.com/clangd/clangd/issues/365

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79576
clang/lib/AST/Decl.cpp
clang/unittests/AST/NamedDeclPrinterTest.cpp