[flang-commits] [flang] 62ef1cb - [flang][msvc] Remove default arguments for function specializations.

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Wed Aug 12 14:46:11 PDT 2020


Author: Michael Kruse
Date: 2020-08-12T16:46:02-05:00
New Revision: 62ef1cb2079123b86878e4bfed3c14db448f1373

URL: https://github.com/llvm/llvm-project/commit/62ef1cb2079123b86878e4bfed3c14db448f1373
DIFF: https://github.com/llvm/llvm-project/commit/62ef1cb2079123b86878e4bfed3c14db448f1373.diff

LOG: [flang][msvc] Remove default arguments for function specializations.

C++ does not allow function template specializations to have default arguments. IIUC callers will only use the default arguments of the primary template. gcc and clang accept the syntax anyway, but msvc emits an error.

See https://en.cppreference.com/w/cpp/language/template_specialization for more details.

This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].

Reviewed By: DavidTruby

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

Added: 
    

Modified: 
    flang/include/flang/Decimal/decimal.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Decimal/decimal.h b/flang/include/flang/Decimal/decimal.h
index 214b1d15d44b..f9808dca8306 100644
--- a/flang/include/flang/Decimal/decimal.h
+++ b/flang/include/flang/Decimal/decimal.h
@@ -105,17 +105,17 @@ ConversionToBinaryResult<PREC> ConvertToBinary(
     const char *&, enum FortranRounding = RoundNearest);
 
 extern template ConversionToBinaryResult<8> ConvertToBinary<8>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 extern template ConversionToBinaryResult<11> ConvertToBinary<11>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 extern template ConversionToBinaryResult<24> ConvertToBinary<24>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 extern template ConversionToBinaryResult<53> ConvertToBinary<53>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 extern template ConversionToBinaryResult<64> ConvertToBinary<64>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 extern template ConversionToBinaryResult<113> ConvertToBinary<113>(
-    const char *&, enum FortranRounding = RoundNearest);
+    const char *&, enum FortranRounding);
 } // namespace Fortran::decimal
 extern "C" {
 #define NS(x) Fortran::decimal::x


        


More information about the flang-commits mailing list