[llvm-bugs] [Bug 38118] New: LLVM does not compile with Visual Studio 17 2018 Preview

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 10 04:34:41 PDT 2018


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

            Bug ID: 38118
           Summary: LLVM does not compile with Visual Studio 17 2018
                    Preview
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: steveire at gmail.com
                CC: llvm-bugs at lists.llvm.org

BuildPasses.cpp does not compile with that compiler, but does compile with
non-preview versions.

C:\dev\src\llvm\build\lib\Passes>CL.exe /c /IC:\dev\src\llvm\build\lib\Passes
/IC:\dev\src\llvm\lib\Passes /IC:\dev\src\llvm\build\include
/IC:\dev\src\llvm\include /Zi /W4 /WX- /diagnostics:classic /MP /O2 /Ob1 /Oi /D
WIN32 /D _WINDOWS /D NDEBUG /D _HAS_EXCEPTIONS=0 /D GTEST_HAS_RTTI=0 /D
_CRT_SECURE_NO_DEPRECATE /D _CRT_SECURE_NO_WARNINGS /D
_CRT_NONSTDC_NO_DEPRECATE /D _CRT_NONSTDC_NO_WARNINGS /D
_SCL_SECURE_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /D UNICODE /D _UNICODE /D
__STDC_CONSTANT_MACROS /D __STDC_FORMAT_MACROS /D __STDC_LIMIT_MACROS /D
"CMAKE_INTDIR=\"RelWithDebInfo\"" /D _UNICODE /D UNICODE /Gm- /MD /GS
/fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Zc:rvalueCast /GR-
/Fo"LLVMPasses.dir\RelWithDebInfo\\"
/Fd"LLVMPasses.dir\RelWithDebInfo\LLVMPasses.pdb" /Gd /TP /wd4141 /wd4146
/wd4180 /wd4244 /wd4258 /wd4267 /wd4291 /wd4345 /wd4351 /wd4355 /wd4456 /wd4457
/wd4458 /wd4459 /wd4503 /wd4624 /wd4722 /wd4800 /wd4100 /wd4127 /wd4512 /wd4505
/wd4610 /wd4510 /wd4702 /wd4245 /wd4706 /wd4310 /wd4701 /wd4703 /wd4389 /wd4611
/wd4805 /wd4204 /wd4577 /wd4091 /wd4592 /wd4319 /wd4324 /FC /errorReport:prompt
/we4238  /Zc:strictStrings -w14062 /EHs-c-
C:\dev\src\llvm\lib\Passes\PassBuilder.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26608.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

PassBuilder.cpp
c:\dev\src\llvm\lib\passes\passregistry.def(121): error C2275:
'std::remove_reference<llvm::TargetIRAnalysis>::type': illegal use of this type
as an expression
c:\dev\src\llvm\lib\passes\passregistry.def(120): note: see declaration of
'std::remove_reference<llvm::TargetIRAnalysis>::type'
c:\dev\src\llvm\lib\passes\passregistry.def(121): error C2923:
'llvm::RequireAnalysisPass':
'std::remove_reference<llvm::TargetIRAnalysis>::type' is not a valid template
type argument for parameter 'AnalysisT'
c:\dev\src\llvm\lib\passes\passregistry.def(120): note: see declaration of
'std::remove_reference<llvm::TargetIRAnalysis>::type'
c:\dev\src\llvm\lib\passes\passregistry.def(121): error C2955:
'llvm::RequireAnalysisPass': use of class template requires template argument
list
c:\dev\src\llvm\include\llvm\ir\passmanager.h(1247): note: see declaration of
'llvm::RequireAnalysisPass'
c:\dev\src\llvm\lib\passes\passregistry.def(120): error C2672:
'llvm::PassManager<llvm::Function,llvm::AnalysisManager<IRUnitT>>::addPass': no
matching overloaded function found
        with
        [
            IRUnitT=llvm::Function
        ]



I reduced it to:



#include <type_traits>

template <typename DerivedT> struct PassInfoMixin
{
};

template <typename T, typename... U>
struct Templ : PassInfoMixin<Templ<T, U...>>
{
};

struct A
{
};

struct TargetMachine
{
  A foo() { return {}; }
};

bool parseFunctionPass() {
  TargetMachine *TM;
  Templ<std::remove_reference<decltype(TM->foo())>::type> t;

  return false;
}




C:\dev\src\playground\cpp>cl.exe rmref.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26608.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

rmref.cpp
rmref.cpp(24): error C2275: 'std::remove_reference<A>::type': illegal use of
this type as an expression
rmref.cpp(24): note: see declaration of 'std::remove_reference<A>::type'
rmref.cpp(24): error C2923: 'Templ': 'std::remove_reference<A>::type' is not a
valid template type argument for parameter 'T'
rmref.cpp(24): note: see declaration of 'std::remove_reference<A>::type'
rmref.cpp(24): error C2133: 't': unknown size
rmref.cpp(24): error C2512: 'Templ': no appropriate default constructor
available
rmref.cpp(9): note: see declaration of 'Templ'

-- 
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/20180710/077e938d/attachment-0001.html>


More information about the llvm-bugs mailing list