[llvm-bugs] [Bug 37171] New: clang complains that it cannot bind to an initializer list

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 18 17:31:21 PDT 2018


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

            Bug ID: 37171
           Summary: clang complains that it cannot bind to an initializer
                    list
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The test code is as follow:

class C {}
a = (const C &) {};

clang++ produces an error message:


1testcase.cpp:2:5: error: reference to type 'const C' cannot bind to an
      initializer list
a = (const C &) {};
    ^           ~~
1 error generated.

However, g++ compiles the above code without any errors. Is this a problem of
clang or gcc?

-- 
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/20180419/0b37489e/attachment.html>


More information about the llvm-bugs mailing list