[LLVMbugs] [Bug 10792] New: warning vs error for dyncast8.C

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 27 13:53:33 PDT 2011


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: unassignedclangbugs at nondot.org
        ReportedBy: rkotler at mips.com
                CC: llvmbugs at cs.uiuc.edu


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 at 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 at 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 at ubuntu-rkotler:~/icpc$ g++
/home/rkotler/gcc-4.4.6/gcc/testsuite/g++.old-deja/g++.mike/dyncast8.Crkotler at 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.



More information about the llvm-bugs mailing list