[llvm-bugs] [Bug 31246] New: -fmodules-local-submodule-visibility fails to merge weak variable definitions.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 2 17:12:00 PST 2016


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

            Bug ID: 31246
           Summary: -fmodules-local-submodule-visibility fails to merge
                    weak variable definitions.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17706
  --> https://llvm.org/bugs/attachment.cgi?id=17706&action=edit
full reproducer

I'm not exactly sure if this is a bug, because weak variable definitions aren't
standard C++; However llvm/Config/abi-breaking.h uses the feature and this
causes the standalone Clang modules build to fail due to multiple definitions
of `VerifyEnableABIBreakingChecks`.

I've attached a full reproducer and Makefile which triggers the bug.

I'm not sure how Clang should merge weak variable definitions, or if it's even
possible.

Basic reproducer:
// foo.h
__attribute__((weak) int x = 42;

// module1.h
#include "foo.h"

// module2.h
#include "foo.h"

// module.modulemap
module test_modules {
  module module1 {
    header "module1.h"
    export *
  }
  module module2 {
    header "module2.h"
    export *
  }
}

// test.cpp
#include "module1.h"

-- 
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/20161203/c953494e/attachment.html>


More information about the llvm-bugs mailing list