Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error recovery improvement for stmtexprs #4442

Closed
lattner opened this issue Apr 25, 2009 · 1 comment
Closed

error recovery improvement for stmtexprs #4442

lattner opened this issue Apr 25, 2009 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer quality-of-implementation

Comments

@lattner
Copy link
Collaborator

lattner commented Apr 25, 2009

Bugzilla Link 4070
Version unspecified
OS All

Extended Description

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 #4437 .

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue May 24, 2022
SymbolGraph ExtractAPI support for C and Objective-C in clang
@philnik777
Copy link
Contributor

This has been fixed in Clang 11: https://godbolt.org/z/o8axnbrd6

@philnik777 philnik777 added clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer and removed clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer quality-of-implementation
Projects
None yet
Development

No branches or pull requests

2 participants