Files
llvm/clang/test/Sema/invalid-bitwidth-expr.mm
Haojian Wu f757ecbf85 [AST] Fix a crash on invalid bitwidth exprs when preserving the recoveryexprs.
Summary:
If the bitwith expr contains errors, we mark the field decl invalid.

This patch also tweaks the behavior of ObjCInterfaceDecl to be consistent with
existing RecordDecl -- getObjCLayout method is only called with valid decls.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76953
2020-03-30 10:52:00 +02:00

14 lines
371 B
Plaintext

// RUN: %clang_cc1 -fobjc-runtime=gcc -frecovery-ast -verify %s
// RUN: %clang_cc1 -fobjc-runtime=gcc -fno-recovery-ast -verify %s
@interface Ivar
{
int Foo : foo(); // expected-error {{use of undeclared identifier}}
};
@end
struct X { int Y: foo(); }; // expected-error {{use of undeclared identifier}}
constexpr int s = sizeof(Ivar);
constexpr int ss = sizeof(X);