[LLVMbugs] [Bug 6793] New: clang: better diagnostic for member function declaration typo

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 6 04:41:16 PDT 2010


           Summary: clang: better diagnostic for member function
                    declaration typo
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

class A {
  int foo();
int A::foo();
  return 4;

clang++ outputs:
x.cpp:4:8: error: out-of-line declaration of a member must be a definition
int A::foo();
x.cpp:5:1: error: expected unqualified-id
2 diagnostics generated.

It'd be better if it'd recognize the ';' typo (or rather copy-pasto), and give
a better hint at whats wrong.

It could recognize ';' followed by '{' as a typo.

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