[llvm-bugs] [Bug 38130] New: Delegating constructor causes error if parameter has same name as class

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 11 02:22:39 PDT 2018


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

            Bug ID: 38130
           Summary: Delegating constructor causes error if parameter has
                    same name as class
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gareth at ignition-web.co.uk
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

struct foo
{
    foo( foo const & ) = default;
    foo( foo const & foo, int)
        : foo{ foo }
        {}
    foo( foo const & foo, char )
        : foo::foo{ foo } // added a redundant type qualifier
        {}
};

<source>:5:11: error: member initializer 'foo' does not name a non-static data
member or base class

        : foo{ foo }

          ^~~~~~~~~~

1 error generated.

Compiler returned: 1

-- 
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/20180711/059550b6/attachment.html>


More information about the llvm-bugs mailing list