[llvm-bugs] [Bug 45605] New: [flang][MSVC] Compilation errors with MSVC 2019.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 19 02:10:45 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45605

            Bug ID: 45605
           Summary: [flang][MSVC] Compilation errors with MSVC 2019.
           Product: flang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Build System
          Assignee: unassignedbugs at nondot.org
          Reporter: chinoune.mehdi at hotmail.com
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    llvm-bugs at lists.llvm.org, sscalpone at nvidia.com

Could you take a look at these compilation errors from MSVC to see if they are
valid or not:


1-
D:\a\llvm-project\llvm-project\flang\include\flang/Evaluate/expression.h(748):
error C3200: 'Fortran::evaluate::Expr<Fortran::evaluate::SomeInteger>': invalid
template argument for template parameter 'F', expected a class template
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\tuple(181): note: see
reference to class template instantiation
'Fortran::evaluate::Expr<Fortran::evaluate::SomeInteger>' being compiled
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\tuple(685): note: see
reference to class template instantiation 'std::_Tuple_val<_This>' being
compiled
        with
        [
            _This=Fortran::evaluate::Expr<Fortran::evaluate::SomeInteger>
        ]


2-
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\fold-integer.cpp(633): error
C2672: 'std::visit': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\fold-integer.cpp(634): error
C2783: 'unknown-type std::visit(_Callable &&,_Variants &&...)': could not
deduce template argument for '<unnamed-symbol>'


3-
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(109):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(111):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(113):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(115):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(117):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments
D:\a\llvm-project\llvm-project\flang\include\flang/Decimal/decimal.h(119):
error C2765: 'Fortran::decimal::ConvertToBinary': an explicit specialization or
instantiation of a function template cannot have any default arguments


4-
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(77): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(77): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(77): note: see
usage of 'Fortran::parser::Space::Space'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(104): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(104): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(104): note: see
usage of 'Fortran::parser::SpaceCheck::SpaceCheck'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(549): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(549): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(549): note: see
usage of 'Fortran::parser::ConsumedAllInputParser::ConsumedAllInputParser'


5-
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(198): error C2672:
'std::visit': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(203): error C2783:
'unknown-type std::visit(_Callable &&,_Variants &&...)': could not deduce
template argument for '<unnamed-symbol>'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1640): note:
see declaration of 'std::visit'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): error C2672:
'std::move': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): error C2893:
Failed to specialize function template 'remove_reference<_Ty>::type
&&std::move(_Ty &&) noexcept'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\type_traits(1464):
note: see declaration of 'std::move'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note: With
the following template arguments:
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note:
'_Ty=unknown-type &'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(211): error C2672:
'std::visit': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): error C2893:
Failed to specialize function template 'unknown-type std::visit(_Callable
&&,_Variants &&...)'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1640): note:
see declaration of 'std::visit'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note: With
the following template arguments:
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note:
'_Callable=Fortran::evaluate::PromoteRealToComplex::<lambda_caab8aad059fdd66d1359e54f8fe1eef>'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note:
'_Variants={}'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(217): note:
'<unnamed-symbol>=void'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): error C2672:
'std::move': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): error C2893:
Failed to specialize function template 'remove_reference<_Ty>::type
&&std::move(_Ty &&) noexcept'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\type_traits(1464):
note: see declaration of 'std::move'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note: With
the following template arguments:
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note:
'_Ty=unknown-type &'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(456): error C2672:
'std::visit': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): error C2893:
Failed to specialize function template 'unknown-type std::visit(_Callable
&&,_Variants &&...)'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1640): note:
see declaration of 'std::visit'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note: With
the following template arguments:
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note:
'_Callable=Fortran::evaluate::LogicalNegation::<lambda_697f49a13ae9878fc7e6e42df5e55cd1>'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note:
'_Variants={}'
D:\a\llvm-project\llvm-project\flang\lib\Evaluate\tools.cpp(458): note:
'<unnamed-symbol>=void'
D:\a\llvm-project\llvm-project\flang\lib\Parser\token-parsers.h(77): error
C2131: expression did not evaluate to a constant


6-
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(145): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(145): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(145): note:
see usage of 'Fortran::parser::AddOperand::AddOperand'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(182): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(182): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(182): note:
see usage of 'Fortran::parser::Level2Expr::Level2Expr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(206): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(206): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(206): note:
see usage of 'Fortran::parser::Level3Expr::Level3Expr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(255): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(255): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(255): note:
see usage of 'Fortran::parser::Level4Expr::Level4Expr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(265): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(265): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(265): note:
see usage of 'Fortran::parser::AndOperand::AndOperand'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(306): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(306): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(306): note:
see usage of 'Fortran::parser::OrOperand::OrOperand'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(330): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(330): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(330): note:
see usage of 'Fortran::parser::EquivOperand::EquivOperand'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(361): error
C2131: expression did not evaluate to a constant
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(361): note:
failure was caused by call of undefined function or one not declared
'constexpr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(361): note:
see usage of 'Fortran::parser::Level5Expr::Level5Expr'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(375): error
C2672: 'applyLambda': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(375): error
C2784: 'auto Fortran::parser::applyLambda(const
std::function<RESULT(PARSER::resultType &&...)> &,const PARSER &...)': could
not deduce template argument for 'const std::function<RESULT(PARSER::resultType
&&...)> &' from 'std::function<Fortran::parser::Expr
(Fortran::parser::DefinedOpName &&,Fortran::parser::Expr &&)>'
D:\a\llvm-project\llvm-project\flang\lib\Parser\basic-parsers.h(630): note: see
declaration of 'Fortran::parser::applyLambda'
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(375): error
C2672: 'Fortran::parser::sourced': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(375): error
C2672: 'Fortran::parser::attempt': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Parser\expr-parsers.cpp(374): error
C2119: 'more': the type for 'auto' cannot be deduced from an empty initializer


7-
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(758): error
C2672: 'std::get_if': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(758): error
C2784: '_Add_pointer<_Ty,void>::type std::get_if(std::variant<_Types...> *)
noexcept': could not deduce template argument for 'std::variant<_Types...> *'
from 'unknown-type'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1337): note:
see declaration of 'std::get_if'
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(758): error
C2975: 'std::get_if': invalid template argument for '_Idx', expected
compile-time constant expression
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1330): note:
see declaration of 'std::get_if'
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(758): error
C2119: 'ssIntExpr': the type for 'auto *' cannot be deduced from an empty
initializer
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(759): error
C2100: illegal indirection
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(851): error
C2672: 'std::get_if': no matching overloaded function found
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(851): error
C2784: '_Add_pointer<_Ty,void>::type std::get_if(std::variant<_Types...> *)
noexcept': could not deduce template argument for 'std::variant<_Types...> *'
from 'unknown-type'
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\include\variant(1337): note:
see declaration of 'std::get_if'
D:\a\llvm-project\llvm-project\flang\lib\Semantics\expression.cpp(851): error
C2975: 'std::get_if': invalid template argument for '_Idx', expected
compile-time constant expression


8-
D:\a\llvm-project\llvm-project\flang\lib\Semantics\symbol.cpp(261): error
C2668: 'Fortran::semantics::Symbol::detailsIf': ambiguous call to overloaded
function
D:\a\llvm-project\llvm-project\flang\include\flang/Semantics/symbol.h(512):
note: could be 'const D
*Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void)
const'
        with
        [
            D=Fortran::semantics::DerivedTypeDetails
        ]
D:\a\llvm-project\llvm-project\flang\include\flang/Semantics/symbol.h(511):
note: or       'D
*Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void)'
        with
        [
            D=Fortran::semantics::DerivedTypeDetails
        ]
D:\a\llvm-project\llvm-project\flang\lib\Semantics\symbol.cpp(261): note: while
trying to match the argument list '()'
D:\a\llvm-project\llvm-project\flang\lib\Semantics\symbol.cpp(261): error
C2119: 'derived': the type for 'auto *' cannot be deduced from an empty
initializer


9-
D:\a\llvm-project\llvm-project\flang\tools\f18-parse-demo\f18-parse-demo.cpp(45):
fatal error C1083: Cannot open include file: 'sys/wait.h': No such file or
directory

I think the last error is obvious.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200419/1e0f3ad6/attachment-0001.html>


More information about the llvm-bugs mailing list