mirror of https://github.com/microsoft/clang.git
PR36307: Consume the #pragma options align annotation token after
semantic analysis to prevent incorrect -Wpragma-pack warning for an included file rdar://37354951 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324651 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3c9141475e
commit
16dc7230de
|
@ -509,8 +509,10 @@ void Parser::HandlePragmaAlign() {
|
|||
Sema::PragmaOptionsAlignKind Kind =
|
||||
static_cast<Sema::PragmaOptionsAlignKind>(
|
||||
reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
|
||||
SourceLocation PragmaLoc = ConsumeAnnotationToken();
|
||||
Actions.ActOnPragmaOptionsAlign(Kind, PragmaLoc);
|
||||
Actions.ActOnPragmaOptionsAlign(Kind, Tok.getLocation());
|
||||
// Consume the token after processing the pragma to enable pragma-specific
|
||||
// #include warnings.
|
||||
ConsumeAnnotationToken();
|
||||
}
|
||||
|
||||
void Parser::HandlePragmaDump() {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#pragma options align=mac68k
|
||||
|
||||
struct S { int x; };
|
||||
|
||||
#pragma options align=reset
|
|
@ -0,0 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -Wpragma-pack -I %S/Inputs -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
#include "pragma-align-no-header-change-warning.h"
|
||||
|
Loading…
Reference in New Issue