[LLVMbugs] [Bug 7672] New: Invalid cv qualifier for non-member function error could be better

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 19 10:12:33 PDT 2010


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

           Summary: Invalid cv qualifier for non-member function error
                    could be better
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: wendling at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


This code:

$ cat a.cpp
struct Foo {
  unsigned F(unsigned a, unsigned b) const;
};

unsigned F(unsigned a, unsigned b) const {
  return a + b * 37 - 927;
}

Produces this error message with clang++:

a.cpp:5:10: error: type qualifier is not allowed on this function
unsigned F(unsigned a, unsigned b) const {
         ^
1 error generated.

It doesn't explain why the qualifier isn't correct. By contrast, g++ does
better:

a.cpp:5: error: non-member function ‘unsigned int F(unsigned int, unsigned
int)’ cannot have cv-qualifier

It mentions that it's a non-member function.

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