[PATCH] D130969: [clang] [HLSL] Fix GCC warnings about virtual methods that are hidden

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 01:03:19 PDT 2022


mstorsjo created this revision.
mstorsjo added a reviewer: beanz.
Herald added a subscriber: Anastasia.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: clang.

This fixes the following warnings produced by GCC 9:

[...] Building CXX object tools/clan...gSema.dir/HLSLExternalSemaSource.cpp.o
In file included from ../tools/clang/include/clang/Sema/ExternalSemaSource.h:15,

  from ../tools/clang/include/clang/Sema/HLSLExternalSemaSource.h:17,
  from ../tools/clang/lib/Sema/HLSLExternalSemaSource.cpp:12:

../tools/clang/include/clang/AST/ExternalASTSource.h:211:16: warning: ‘virtual void clang::ExternalASTSource::CompleteType(clang::ObjCInterfaceDecl*)’ was hidden [-Woverloaded-virtual]

  211 |   virtual void CompleteType(ObjCInterfaceDecl *Class);
      |                ^~~~~~~~~~~~

In file included from ../tools/clang/lib/Sema/HLSLExternalSemaSource.cpp:12:
../tools/clang/include/clang/Sema/HLSLExternalSemaSource.h:49:8: warning:   by  virtual void clang::HLSLExternalSemaSource::CompleteType(clang::TagDecl*)’ [-Woverloaded-virtual]

  49 |   void CompleteType(TagDecl *Tag) override;
     |        ^~~~~~~~~~~~


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130969

Files:
  clang/include/clang/Sema/HLSLExternalSemaSource.h


Index: clang/include/clang/Sema/HLSLExternalSemaSource.h
===================================================================
--- clang/include/clang/Sema/HLSLExternalSemaSource.h
+++ clang/include/clang/Sema/HLSLExternalSemaSource.h
@@ -45,6 +45,7 @@
   /// Inform the semantic consumer that Sema is no longer available.
   void ForgetSema() override { SemaPtr = nullptr; }
 
+  using ExternalASTSource::CompleteType;
   /// Complete an incomplete HLSL builtin type
   void CompleteType(TagDecl *Tag) override;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130969.449209.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220802/48a2ed76/attachment.bin>


More information about the cfe-commits mailing list