[LLVMbugs] [Bug 15617] New: suppress "expression result unused" when expression is parsed with errors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 28 08:41:53 PDT 2013


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

            Bug ID: 15617
           Summary: suppress "expression result unused" when expression is
                    parsed with errors
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vanyacpp at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On the following code:

int main()
{
    sizeof (int) 0;
}

Clang gives too many errors:

CLANG
1.cpp:3:17: error: expected ';' after expression
    sizeof (int) 0;
                ^
                ;
1.cpp:3:5: warning: expression result unused
    sizeof (int) 0;
    ^~~~~~~~~~~~
1.cpp:3:18: warning: expression result unused
    sizeof (int) 0;
                 ^
2 warnings and 1 error generated.
GCC
1.cpp: In function 'int main()':
1.cpp:3:18: error: expected ';' before numeric constant
MSVC2012 NOV CTP
1.cpp
1.cpp(3) : error C2143: syntax error : missing ';' before 'constant'

-- 
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/20130328/1d3675b1/attachment.html>


More information about the llvm-bugs mailing list