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

           Summary: Not an error for gcc -- error: default initialization
                    of an object of const type '...' requires a
                    user-provided default constructor
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Script started on Sat Apr  3 16:29:45 2010
$ cat ccd.cpp
struct A {
        A() {}
};

class B {
        A a_;
};

int
foo()
{
        const B b;
        return 0;
}
$ g++ --version
g++ (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ -c ccd.cpp
$ clang++ --version
clang version 1.5 (trunk)
Target: i386-portbld-freebsd9.0
Thread model: posix
$ clang++ -c ccd.cpp
ccd.cpp:12:10: error: default initialization of an object of const type 'B
const' requires a user-provided default constructor
        const B b;
                ^
1 diagnostic generated.
$ ^D
Script done on Sat Apr  3 16:30:29 2010

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to