forked from OSchip/llvm-project
PR31783: Don't request the alignment of an invalid declaration.
Fixes an assertion failure on PS4 targets. llvm-svn: 293333
This commit is contained in:
parent
35ce5dac7f
commit
78aacbe2f9
|
@ -10930,7 +10930,8 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) {
|
|||
if (unsigned MaxAlign = Context.getTargetInfo().getMaxTLSAlign()) {
|
||||
// Protect the check so that it's not performed on dependent types and
|
||||
// dependent alignments (we can't determine the alignment in that case).
|
||||
if (VD->getTLSKind() && !hasDependentAlignment(VD)) {
|
||||
if (VD->getTLSKind() && !hasDependentAlignment(VD) &&
|
||||
!VD->isInvalidDecl()) {
|
||||
CharUnits MaxAlignChars = Context.toCharUnitsFromBits(MaxAlign);
|
||||
if (Context.getDeclAlign(VD) > MaxAlignChars) {
|
||||
Diag(VD->getLocation(), diag::err_tls_var_aligned_over_maximum)
|
||||
|
|
|
@ -6,3 +6,5 @@ void f() {
|
|||
}
|
||||
|
||||
typedef auto PR25449(); // expected-error {{'auto' not allowed in typedef}}
|
||||
|
||||
thread_local auto x; // expected-error {{requires an initializer}}
|
||||
|
|
Loading…
Reference in New Issue