[LLVMbugs] [Bug 17786] New: Incorrect mangling of member function with __restrict qualifier

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 3 00:42:30 PDT 2013


            Bug ID: 17786
           Summary: Incorrect mangling of member function with __restrict
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ds at alliedmods.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Test case:

struct Foo
    void bar() __restrict { }

int main()
    Foo obj;
    return 0;

The trunk version of clang (r193937 as of this post) mangles Foo::bar() as
_ZNr3Foo3barEv, but gcc/g++ mangles this as _ZN3Foo3barEv instead. The key
difference is that clang is adding the 'r' due to the __restrict qualifier.

The note about restrict in this C++ ABI document
(http://mentorembedded.github.io/cxx-abi/abi.html#mangle.CV-qualifiers) seems
to indicate that it shouldn't be included in the mangled name since __restrict
isn't used for overloading purposes.

I should also probably note that this problem appears to be fixed in Apple's
version of clang on OS X as of Xcode 5.0 (clang-500.2.75), but versions prior
to this definitely exhibited the same problem.

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/20131103/75465588/attachment.html>

More information about the llvm-bugs mailing list