[LLVMbugs] [Bug 23547] New: Clang frontend behaves differently from g++. Constructor call

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 16 11:53:07 PDT 2015


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

            Bug ID: 23547
           Summary: Clang frontend behaves differently from g++.
                    Constructor call
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: denis.yaroshevskij at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Code snippet:

"""""""""""""""""""""""
struct Widget {};

int main()
{
  Widget x = Widget::Widget();
}
"""""""""""""""""""""""

Clang++ 3.6.0 compiles this cleanly, without a warning,

while g++ 4.7.3 produces an error:
error: cannot call constructor ‘Widget::Widget’ directly [-fpermissive]

I do not know, what the standard has to say about this,
but one of this behaviors doesn't seem right.

-- 
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/20150516/2e1b47de/attachment.html>


More information about the llvm-bugs mailing list