[LLVMbugs] [Bug 7917] New: bogus Diagnostic for static const functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 15 15:29:26 PDT 2010


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

           Summary: bogus Diagnostic for static const functions
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bugzilla-clang at sogetthis.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


When it encounters a const static function Clang will not only report this but
also a 'conflicting types' error that actually does not exist in the source. It
looks like Clang just ignores the 'const' in the declaration which then leads
to inconsistency with the definition. (Hope I did not mix up declaration and
definition...)


example:
--------

$ cat test.cpp 
class Foo {
  static void bar() const;
};
void Foo::bar() const {}


$ clang++ test.cpp 
test.cpp:2:15: error: type qualifier is not allowed on this function
  static void bar() const;
              ^
test.cpp:5:11: error: conflicting types for 'bar'
void Foo::bar() const {}
          ^
test.cpp:2:15: note: previous declaration is here
  static void bar() const;
              ^
2 errors generated.

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