[LLVMbugs] [Bug 10412] New: clang accepts extra qualifier

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 19 13:28:01 PDT 2011


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

           Summary: clang accepts extra qualifier
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


clang compiles
-----------------
struct A {
  A();
};

A* f() {
  return new A::A();
}
----------------

gcc complains:

test.cc: In function ‘A* f()’:
test.cc:6:14: error: expected type-specifier
test.cc:6:14: error: cannot convert ‘int*’ to ‘A*’ in return
test.cc:6:14: error: expected ‘;’
test.cc:6:19: error: cannot call constructor ‘A::A’ directly [-fpermissive]
test.cc:6:19: error:   for a function-style cast, remove the redundant ‘::A’
[-fpermissive]

edg rejects it too.

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