[flang-commits] [flang] 6d2d730 - [flang] Fix compilation warning in check-directive-structure.h
Tim Keith via flang-commits
flang-commits at lists.llvm.org
Wed Aug 5 18:03:52 PDT 2020
Author: Tim Keith
Date: 2020-08-05T18:03:41-07:00
New Revision: 6d2d73059fda5a63f2b34a9482acc0445e0956a4
URL: https://github.com/llvm/llvm-project/commit/6d2d73059fda5a63f2b34a9482acc0445e0956a4
DIFF: https://github.com/llvm/llvm-project/commit/6d2d73059fda5a63f2b34a9482acc0445e0956a4.diff
LOG: [flang] Fix compilation warning in check-directive-structure.h
Clang 9 gets the following warning after revision `D85104`.
```
../../flang/lib/Semantics/check-directive-structure.h:36:7: error: 'Fortran::semantics::DirectiveStructureChecker<llvm::omp::Directive, llvm::omp::Clause, Fortran::parser::OmpClause, 77>' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]
```
The fix is the make the destructor virtual. Neither it nor the
constructor need to be public, so make them protected.
Differential Revision: https://reviews.llvm.org/D85383
Added:
Modified:
flang/lib/Semantics/check-directive-structure.h
Removed:
################################################################################
diff --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h
index a5de0564677c..6755e475832a 100644
--- a/flang/lib/Semantics/check-directive-structure.h
+++ b/flang/lib/Semantics/check-directive-structure.h
@@ -34,13 +34,13 @@ template <typename C, std::size_t ClauseEnumSize> struct DirectiveClauses {
// typename PC is the parser class defined in parse-tree.h for the clauses.
template <typename D, typename C, typename PC, std::size_t ClauseEnumSize>
class DirectiveStructureChecker : public virtual BaseChecker {
-public:
+protected:
DirectiveStructureChecker(SemanticsContext &context,
std::unordered_map<D, DirectiveClauses<C, ClauseEnumSize>>
directiveClausesMap)
: context_{context}, directiveClausesMap_(directiveClausesMap) {}
+ virtual ~DirectiveStructureChecker() {}
-protected:
struct DirectiveContext {
DirectiveContext(parser::CharBlock source, D d)
: directiveSource{source}, directive{d} {}
More information about the flang-commits
mailing list