[PATCH] D77644: [clangd] Handle additional includes while parsing ASTs

Mikael Holmén via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 02:40:27 PDT 2020


uabelho added inline comments.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1034
   const PreambleData &Preamble;
-  const PreamblePatch &Patch;
+  llvm::Optional<const PreamblePatch> Patch;
   llvm::StringRef Contents;
----------------
Hi!

When compiling with gcc 7.4 I see a warning that I think originates from this line:

```
[4032/4668] Building CXX object tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/CodeComplete.cpp.o
In file included from /data/repo/master/llvm/include/llvm/ADT/STLExtras.h:19:0,
                 from /data/repo/master/llvm/include/llvm/ADT/StringRef.h:12,
                 from /data/repo/master/clang-tools-extra/clangd/URI.h:12,
                 from /data/repo/master/clang-tools-extra/clangd/Protocol.h:26,
                 from /data/repo/master/clang-tools-extra/clangd/Headers.h:12,
                 from /data/repo/master/clang-tools-extra/clangd/CodeComplete.h:18,
                 from /data/repo/master/clang-tools-extra/clangd/CodeComplete.cpp:20:
/data/repo/master/llvm/include/llvm/ADT/Optional.h: In instantiation of 'void llvm::optional_detail::OptionalStorage<T, <anonymous> >::emplace(Args&& ...) [with Args = {const clang::clangd::PreamblePatch}; T = const clang::clangd::PreamblePatch; bool <anonymous> = false]':
/data/repo/master/llvm/include/llvm/ADT/Optional.h:55:14:   required from 'llvm::optional_detail::OptionalStorage<T, <anonymous> >::OptionalStorage(llvm::optional_detail::OptionalStorage<T, <anonymous> >&&) [with T = const clang::clangd::PreamblePatch; bool <anonymous> = false]'
/data/repo/master/llvm/include/llvm/ADT/Optional.h:228:3:   required from here
/data/repo/master/llvm/include/llvm/ADT/Optional.h:89:12: warning: cast from type 'const clang::clangd::PreamblePatch*' to type 'void*' casts away qualifiers [-Wcast-qual]
     ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77644





More information about the cfe-commits mailing list