[llvm-bugs] [Bug 48006] New: Bad error "uuid does not match previous declaration" when a duplicate __declspec(uuid) is in the precomp

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 28 20:25:50 PDT 2020


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

            Bug ID: 48006
           Summary: Bad error "uuid does not match previous declaration"
                    when a duplicate __declspec(uuid) is in the precomp
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shigoyal at microsoft.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

This is valid C++.
This error only repros with Clang 11 when using a precomp.
Does not repro at all in Clang 10 and also doesn't repro when not using precomp
in Clang 11.

============

Repro Steps:

precomp.h:
struct __declspec(uuid("edbf631b-8001-47bd-8b77-ca235e14d4c5")) Foo;

foo.cpp:
#include "precomp.h"

struct __declspec(uuid("edbf631b-8001-47bd-8b77-ca235e14d4c5")) Bar;
struct __declspec(uuid("edbf631b-8001-47bd-8b77-ca235e14d4c5")) Foo;

Commands to run the build:
clang-cl.exe /c /Yc /Fpprecomp.pch /Foprecomp.obj /Tp precomp.h
clang-cl.exe /c /Yuprecomp.h /Fpprecomp.pch /Fo"." foo.cpp

Error:
foo.cpp(4,19): error: uuid does not match previous declaration
struct __declspec(uuid("edbf631b-8001-47bd-8b77-ca235e14d4c5")) Foo;
                  ^
./precomp.h(1,19): note: previous uuid specified here
struct __declspec(uuid("edbf631b-8001-47bd-8b77-ca235e14d4c5")) Foo;

-- 
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/20201029/cbf759c9/attachment.html>


More information about the llvm-bugs mailing list