forked from OSchip/llvm-project
[Sema] Fix a null pointer reference crash.
Differential Revision: https://reviews.llvm.org/D110315
This commit is contained in:
parent
828422747d
commit
3778c1cd6e
|
@ -14493,7 +14493,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
|
|||
FunctionScopeInfo *FSI = getCurFunction();
|
||||
FunctionDecl *FD = dcl ? dcl->getAsFunction() : nullptr;
|
||||
|
||||
if (FSI->UsesFPIntrin && !FD->hasAttr<StrictFPAttr>())
|
||||
if (FSI->UsesFPIntrin && FD && !FD->hasAttr<StrictFPAttr>())
|
||||
FD->addAttr(StrictFPAttr::CreateImplicit(Context));
|
||||
|
||||
sema::AnalysisBasedWarnings::Policy WP = AnalysisWarnings.getDefaultPolicy();
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -frounding-math -verify %s
|
||||
|
||||
template <class b> b::a() {} // expected-error {{nested name specifier}}
|
Loading…
Reference in New Issue