[flang-commits] [PATCH] D111677: [flang][NFC] Address warnings from Windows build

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Oct 12 13:43:37 PDT 2021


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

An LLVM Flang build bot for Windows recently failed with a
bunch of warning messages.  None were from recent changes to
the Fortran compiler; I suspect that a newer (or maybe older)
version of MSVC was being used, or perhaps a different set of
compiler options were temporarily applied to the build, since
the buildbot status went back to green shortly thereafter.

Most of the warnings looked bogus to me, but some are legitimate
concerns and we might as well clean them up.  This patch does so.


https://reviews.llvm.org/D111677

Files:
  flang/include/flang/Evaluate/call.h
  flang/include/flang/Evaluate/expression.h
  flang/include/flang/Semantics/symbol.h
  flang/lib/Evaluate/call.cpp


Index: flang/lib/Evaluate/call.cpp
===================================================================
--- flang/lib/Evaluate/call.cpp
+++ flang/lib/Evaluate/call.cpp
@@ -220,5 +220,4 @@
 
 void ProcedureRef::Deleter(ProcedureRef *p) { delete p; }
 
-FOR_EACH_SPECIFIC_TYPE(template class FunctionRef, )
 } // namespace Fortran::evaluate
Index: flang/include/flang/Semantics/symbol.h
===================================================================
--- flang/include/flang/Semantics/symbol.h
+++ flang/include/flang/Semantics/symbol.h
@@ -683,7 +683,7 @@
   const Symbol *GetParentComponent(const Scope * = nullptr) const;
 
   template <std::size_t> friend class Symbols;
-  template <class, std::size_t> friend struct std::array;
+  template <class, std::size_t> friend class std::array;
 };
 
 llvm::raw_ostream &operator<<(llvm::raw_ostream &, Symbol::Flag);
Index: flang/include/flang/Evaluate/expression.h
===================================================================
--- flang/include/flang/Evaluate/expression.h
+++ flang/include/flang/Evaluate/expression.h
@@ -619,7 +619,8 @@
 // There are no relations between LOGICAL values.
 
 template <typename T>
-struct Relational : public Operation<Relational<T>, LogicalResult, T, T> {
+class Relational : public Operation<Relational<T>, LogicalResult, T, T> {
+public:
   using Result = LogicalResult;
   using Base = Operation<Relational, LogicalResult, T, T>;
   using Operand = typename Base::template Operand<0>;
@@ -651,10 +652,10 @@
   common::MapTemplate<Relational, DirectlyComparableTypes> u;
 };
 
-FOR_EACH_INTEGER_KIND(extern template struct Relational, )
-FOR_EACH_REAL_KIND(extern template struct Relational, )
-FOR_EACH_CHARACTER_KIND(extern template struct Relational, )
-extern template struct Relational<SomeType>;
+FOR_EACH_INTEGER_KIND(extern template class Relational, )
+FOR_EACH_REAL_KIND(extern template class Relational, )
+FOR_EACH_CHARACTER_KIND(extern template class Relational, )
+extern template class Relational<SomeType>;
 
 // Logical expressions of a kind bigger than LogicalResult
 // do not include Relational<> operations as possibilities,
Index: flang/include/flang/Evaluate/call.h
===================================================================
--- flang/include/flang/Evaluate/call.h
+++ flang/include/flang/Evaluate/call.h
@@ -252,9 +252,6 @@
       : ProcedureRef{std::move(p), std::move(a)} {}
 
   std::optional<DynamicType> GetType() const { return proc_.GetType(); }
-  std::optional<Constant<Result>> Fold(FoldingContext &); // for intrinsics
 };
-
-FOR_EACH_SPECIFIC_TYPE(extern template class FunctionRef, )
 } // namespace Fortran::evaluate
 #endif // FORTRAN_EVALUATE_CALL_H_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111677.379171.patch
Type: text/x-patch
Size: 2693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211012/a857d74e/attachment.bin>


More information about the flang-commits mailing list