forked from OSchip/llvm-project
[OPENMP]Fix PR47790: segfault in frontend while parsing Objective-C with OpenMP.
Need to check if the sema is actually finishing a function decl. Differential Revision: https://reviews.llvm.org/D91376
This commit is contained in:
parent
9c504ec06d
commit
07b568a9c8
|
@ -14598,7 +14598,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
|
|||
DiscardCleanupsInEvaluationContext();
|
||||
}
|
||||
|
||||
if (LangOpts.OpenMP || LangOpts.CUDA || LangOpts.SYCLIsDevice) {
|
||||
if (FD && (LangOpts.OpenMP || LangOpts.CUDA || LangOpts.SYCLIsDevice)) {
|
||||
auto ES = getEmissionStatus(FD);
|
||||
if (ES == Sema::FunctionEmissionStatus::Emitted ||
|
||||
ES == Sema::FunctionEmissionStatus::Unknown)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// RUN: %clang_cc1 -fopenmp -fsyntax-only -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
class Foo {
|
||||
int a;
|
||||
};
|
||||
|
||||
@interface NSObject
|
||||
@end
|
||||
|
||||
@interface Bar : NSObject {
|
||||
Foo *foo;
|
||||
}
|
||||
- (void)setSystemAndWindowCocoa:(class Foo *)foo_1;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Bar : NSObject
|
||||
- (void)setSystemAndWindowCocoa:(Foo *)foo_1 {
|
||||
foo = foo_1;
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue