[LLVMbugs] [Bug 20792] New: "Function is marked as dllimport, but not external" error after clang tries to drop dllimport attribute

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 28 13:55:50 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20792

            Bug ID: 20792
           Summary: "Function is marked as dllimport, but not external"
                    error after clang tries to drop dllimport attribute
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code:

  __declspec(dllimport) int f(int x);
  int user(int x) {
    return f(x);
  }
  int f(int x) { return 1; }

Compiled with:

  clang -cc1 -triple -i686-pc-win32 -emit-obj a.cc

Results in this output:

  a.cc:5:5: warning: 'f' redeclared without 'dllimport' attribute: previous
'dllimport' ignored
  int f(int x) { return 1; }
      ^
  a.cc:1:27: note: previous declaration is here
  __declspec(dllimport) int f(int x);
                            ^
  a.cc:1:12: note: previous attribute is here
  __declspec(dllimport) int f(int x);
             ^
  Function is marked as dllimport, but not external.
  i32 (i32)* @"\01?f@@YAHH at Z"
  fatal error: error in backend: Broken function found, compilation aborted!


I think the llvm::Function object has already been created with the dllimport
attribute, before clang sees the definition of f() and drops it from the AST.

-- 
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/20140828/8f24ff76/attachment.html>


More information about the llvm-bugs mailing list