tom-anders created this revision. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. tom-anders requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added projects: clang, clang-tools-extra.
Fixes https://github.com/clangd/clangd/issues/1184 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D128202 Files: clang-tools-extra/clangd/unittests/HoverTests.cpp clang/lib/AST/DeclPrinter.cpp Index: clang/lib/AST/DeclPrinter.cpp =================================================================== --- clang/lib/AST/DeclPrinter.cpp +++ clang/lib/AST/DeclPrinter.cpp @@ -1007,6 +1007,10 @@ } } + if (D->isEffectivelyFinal()) { + Out << " final"; + } + if (D->isCompleteDefinition()) { // Print the base classes if (D->getNumBases()) { Index: clang-tools-extra/clangd/unittests/HoverTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/HoverTests.cpp +++ clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -198,7 +198,7 @@ typename = char, int = 0, bool Q = false, - class... Ts> class Foo {}; + class... Ts> class Foo final {}; template <template<typename, bool...> class T> [[F^oo]]<T> foo; )cpp", @@ -209,7 +209,7 @@ HI.Definition = R"cpp(template <template <typename, bool...> class C, typename = char, int = 0, bool Q = false, class... Ts> -class Foo {})cpp"; +class Foo final {})cpp"; HI.TemplateParameters = { {{"template <typename, bool...> class"}, std::string("C"),
Index: clang/lib/AST/DeclPrinter.cpp =================================================================== --- clang/lib/AST/DeclPrinter.cpp +++ clang/lib/AST/DeclPrinter.cpp @@ -1007,6 +1007,10 @@ } } + if (D->isEffectivelyFinal()) { + Out << " final"; + } + if (D->isCompleteDefinition()) { // Print the base classes if (D->getNumBases()) { Index: clang-tools-extra/clangd/unittests/HoverTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/HoverTests.cpp +++ clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -198,7 +198,7 @@ typename = char, int = 0, bool Q = false, - class... Ts> class Foo {}; + class... Ts> class Foo final {}; template <template<typename, bool...> class T> [[F^oo]]<T> foo; )cpp", @@ -209,7 +209,7 @@ HI.Definition = R"cpp(template <template <typename, bool...> class C, typename = char, int = 0, bool Q = false, class... Ts> -class Foo {})cpp"; +class Foo final {})cpp"; HI.TemplateParameters = { {{"template <typename, bool...> class"}, std::string("C"),
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits