[llvm-bugs] [Bug 42842] New: Generated COM code fails to compile with 9.0.0-RC1

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 31 06:02:05 PDT 2019


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

            Bug ID: 42842
           Summary: Generated COM code fails to compile with 9.0.0-RC1
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

// C:\LLVM_9_0_0-RC1\bin\clang-cl.exe -ferror-limit=1 /nologo /c /EHsc
/std:c++17  -fms-compatibility-version=19.11  t.cpp

#include <comdef.h>

struct __declspec(uuid("99bca7bd-e8c4-4d5f-a0cf-6d907901ff07"))
ISAXEntityResolver;
_COM_SMARTPTR_TYPEDEF(ISAXEntityResolver, __uuidof(ISAXEntityResolver));
inline ISAXEntityResolverPtr getEntityResolver() {
   struct ISAXEntityResolver * _result = 0;
   return ISAXEntityResolverPtr(_result, false);
}


ERROR:
======
In file included from t.cpp:2:
In file included from C:\Vs2017\VC\Tools\MSVC\14.16.27023\include\comdef.h:467:
C:\Vs2017\VC\Tools\MSVC\14.16.27023\include\comip.h(174,16): error: conflicting
types for
      '_com_ptr_t'
    template<> _com_ptr_t(Interface* pInterface) throw()
               ^
t.cpp(6,30): note: in instantiation of template class
'_com_ptr_t<_com_IIID<ISAXEntityResolver,
      &__uuidof(ISAXEntityResolver)> >' requested here
inline ISAXEntityResolverPtr getEntityResolver() {
                             ^
C:\Vs2017\VC\Tools\MSVC\14.16.27023\include\comip.h(174,16): note: previous
declaration is
      here
    template<> _com_ptr_t(Interface* pInterface) throw()
               ^

NOTES:
======
For some reason, Clang is detecting a method with another definition which is
on the same line. As if it parses the header twice

-- 
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/20190731/12b5a9fc/attachment.html>


More information about the llvm-bugs mailing list