[LLVMbugs] [Bug 17337] New: Rejects friend function due to language linkage

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 23 20:46:52 PDT 2013


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

            Bug ID: 17337
           Summary: Rejects friend function due to language linkage
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alp at nuanti.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

These two cases broke when r181163 started using lexical DC to check for
language linkage.

The lexical approach to linkage specs in clang seems to be at odds with the
language ref resulting in a lot of bugs like this.

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130429/079224.html


namespace test16b {
  extern "C++" {
    class Foo;
    extern "C" int bar(Foo *y);
    class Foo {
      int x;
      friend int bar(Foo *y);
    };
    extern "C" int bar(Foo *y) {
      return y->x;
    }
  }
}

namespace test16c {
  extern "C" {
    class Foo;
    extern "C++" int bar(Foo *y);
    class Foo {
      int x;
      friend int bar(Foo *y);
    };
    extern "C++" int bar(Foo *y) {
      return y->x;
    }
  }
}

-- 
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/20130924/e39ebf82/attachment.html>


More information about the llvm-bugs mailing list