[llvm-bugs] [Bug 35114] New: Poor error message from control flow at global scope
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Oct 27 19:39:13 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=35114
Bug ID: 35114
Summary: Poor error message from control flow at global scope
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: david at doublewise.net
CC: llvm-bugs at lists.llvm.org
If you compile the following code:
while(true) {}
You get the not especially helpful error message:
<source>:1:1: error: expected unqualified-id
while(true) {}
^
1 error generated.
This came up for me in the context of calling a macro that wrapped a few
statements in a `do { ... } while(false);` construct, and I spend a fair amount
of time looking for a missing semicolon somewhere before I finally found the
problem. I would have preferred to get a message along the lines of "while
loops not allowed outside of functions" or something else that directly says
the problem from the user's perspective.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171028/c3c6bd9e/attachment.html>
More information about the llvm-bugs
mailing list