[PATCH] D107047: [clangd] Fix the crash in getQualification

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 29 03:24:10 PDT 2021


kadircet added a comment.

thanks for chasing this down! as mentioned offline a test case like:

  namespace ns {
  extern "C" {
  typedef int foo;
  }
  foo Fo^o(int id) { return id; }
  }

in define outline should be enough to ensure it is WAI.



================
Comment at: clang-tools-extra/clangd/AST.cpp:129
         continue;
     }
     // Stop if this namespace is already visible at DestContext.
----------------
rather than having `!NNS` in the check below it might be nicer to put:
```
else {
// Other types of contexts cannot be spelled in code, just skip over them.
continue;
}
```

I believe continue makes sense, that way we can spell in cases like:
```
namespace ns {
extern "C" {
typedef int foo;
}
foo Foo(int id) { return id; }
}
```

`foo` should still become `ns::foo` in other contexts.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107047/new/

https://reviews.llvm.org/D107047



More information about the cfe-commits mailing list