[flang-commits] [flang] 49142dd - [flang][NFC] Address warnings from Windows build

peter klausler via flang-commits flang-commits at lists.llvm.org
Tue Oct 12 16:00:16 PDT 2021


Author: peter klausler
Date: 2021-10-12T16:00:09-07:00
New Revision: 49142dd4a5c852ac5a87f2b5bd0c4a1d1e785924

URL: https://github.com/llvm/llvm-project/commit/49142dd4a5c852ac5a87f2b5bd0c4a1d1e785924
DIFF: https://github.com/llvm/llvm-project/commit/49142dd4a5c852ac5a87f2b5bd0c4a1d1e785924.diff

LOG: [flang][NFC] Address warnings from Windows build

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.

Differential Revision: https://reviews.llvm.org/D111677

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Evaluate/call.h b/flang/include/flang/Evaluate/call.h
index 7cf509c14a1f1..b757f958b81e9 100644
--- a/flang/include/flang/Evaluate/call.h
+++ b/flang/include/flang/Evaluate/call.h
@@ -252,9 +252,6 @@ template <typename A> class FunctionRef : public ProcedureRef {
       : 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_

diff  --git a/flang/include/flang/Evaluate/expression.h b/flang/include/flang/Evaluate/expression.h
index c33c2422af13c..798aa3ec1105b 100644
--- a/flang/include/flang/Evaluate/expression.h
+++ b/flang/include/flang/Evaluate/expression.h
@@ -619,7 +619,8 @@ FOR_EACH_CHARACTER_KIND(extern template class Expr, )
 // 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 @@ template <> class Relational<SomeType> {
   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,

diff  --git a/flang/include/flang/Semantics/symbol.h b/flang/include/flang/Semantics/symbol.h
index 2282d2bf19192..e654cdc739675 100644
--- a/flang/include/flang/Semantics/symbol.h
+++ b/flang/include/flang/Semantics/symbol.h
@@ -683,7 +683,7 @@ class Symbol {
   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);

diff  --git a/flang/lib/Evaluate/call.cpp b/flang/lib/Evaluate/call.cpp
index 18d51a2b652a5..9328ff79852ec 100644
--- a/flang/lib/Evaluate/call.cpp
+++ b/flang/lib/Evaluate/call.cpp
@@ -220,5 +220,4 @@ ProcedureRef::~ProcedureRef() {}
 
 void ProcedureRef::Deleter(ProcedureRef *p) { delete p; }
 
-FOR_EACH_SPECIFIC_TYPE(template class FunctionRef, )
 } // namespace Fortran::evaluate


        


More information about the flang-commits mailing list