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

             Bug #: 12828
           Summary: Fixit for variable definition after label
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


The following code is a syntax error in C99 (or at least, clang and gcc agree
that it's a syntax error):

---
int main() {
foo:
    int x = 0;
    return x;
}
---

It can be fixed by putting an empty statement after the label:

---
int main() {
foo:;
    int x = 0;
    return x;
}
---

However, the error given by clang isn't very descriptive:

---
def-after-label.c:3:5: error: expected expression
    int x = 0;
---

A more descriptive error message noting that a label may not be followed
immediately by a variable definition and a fixit inserting the empty statement
would be more helpful.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to