LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 4070 - error recovery improvement for stmtexprs
Summary: error recovery improvement for stmtexprs
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: unspecified
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords: quality-of-implementation
Depends on:
Blocks:
 
Reported: 2009-04-25 14:10 PDT by Chris Lattner
Modified: 2010-03-12 00:57 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2009-04-25 14:10:20 PDT
In this example:

struct fooo {} ;
struct fooo x;

void test(void) {

  *({
    0;
    x/x;
    });
}

We emit two diagnostics: one about x/x (good) and one about "indirection requires a pointer operand".  The problem is that we correctly kill the expression tree for x/x, but that means that we build and return a  compound statement with just { 0; } and the stmt expr gets built with type int.  We should somehow propagate invalidity of the last statement in a stmt expr up into the stmt expr itself.

This came from PR4065.