[llvm-bugs] [Bug 24986] New: Regression in __uuidof support: &__uuidof(X) template parameter turns into __uuidof(X)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 29 08:38:47 PDT 2015


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

            Bug ID: 24986
           Summary: Regression in __uuidof support: &__uuidof(X) template
                    parameter turns into __uuidof(X)
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sebastian at theophil.net
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14954
  --> https://llvm.org/bugs/attachment.cgi?id=14954&action=edit
Self-contained reproduction

The COM headers use pointers to the IID/GUID struct as template parameters,
e.g. in the _com_IIID class. This was supported in clang 3.6 but stopped
working again in clang 3.7 onwards. The bug is still present in the Trunk, as
far as I can tell with http://melpon.org/wandbox

    struct __declspec(uuid("00000000-0000-0000-c000-000000000046")) Test {};

    template<typename _Interface, const IID* _IID /*= &__uuidof(_Interface)*/> 
    class _com_IIID {};

    typedef _com_IIID<Test, &__uuidof(Test)> IID_Test

IID_Test is (silently) instantiated not with a IID const* but with the IID
itself. The attached example prints the instantiated types and IID_Test is
indeed a _com_IIID<Test, __uuidof(Test)> (note the missing & in front of
__uuidof)

To reproduce, compile the attached (complete) example with 

    c++ --std=c++1z -fms-extensions uuid.cpp

-- 
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/20150929/6c548437/attachment.html>


More information about the llvm-bugs mailing list