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

           Summary: warning vs error for dyncast8.C
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=7163)
 --> (http://llvm.org/bugs/attachment.cgi?id=7163)
g++.old-deja/g++.mike/dyncast8.C

g++ reports no warning or error.

icpc reports a warning.

clang++ an error.

for g++ compatibility mode, i think that that things which are easy to allow
should be allowed. 

rkotler@ubuntu-rkotler:~/icpc$ icpc
/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C(14):
warning #854: const variable "b" requires an initializer -- class "Derived" has
no user-provided default constructor
      const Derived b;
                    ^

rkotler@ubuntu-rkotler:~/icpc$ /home/rkotler/build_llvm/install/bin/clang++ 
/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C
/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.C:14:19:
error: 
      default initialization of an object of const type 'const Derived'
      requires a user-provided default constructor
    const Derived b;
                  ^
1 error generated.
rkotler@ubuntu-rkotler:~/icpc$ g++
/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.Crkotler@ubuntu-rkotler:~/icpc$

-- 
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