forked from OSchip/llvm-project
Also don't warn about force_align_arg_pointer on function typedefs. (This will
break if you declare an actual function using that typedef. Come to think of it, maybe I should make this part of the type.) llvm-svn: 96570
This commit is contained in:
parent
c451027db9
commit
9fcead75ee
|
@ -87,7 +87,8 @@ static void HandleX86ForceAlignArgPointerAttr(Decl *D,
|
|||
return;
|
||||
// Also don't warn on function pointer typedefs.
|
||||
TypedefDecl *TD = dyn_cast<TypedefDecl>(D);
|
||||
if (TD && TD->getUnderlyingType()->isFunctionPointerType())
|
||||
if (TD && (TD->getUnderlyingType()->isFunctionPointerType() ||
|
||||
TD->getUnderlyingType()->isFunctionType()))
|
||||
return;
|
||||
// Attribute can only be applied to function types.
|
||||
if (!isa<FunctionDecl>(D)) {
|
||||
|
|
|
@ -16,4 +16,6 @@ void __attribute__((force_align_arg_pointer)) d(void) {}
|
|||
// Attribute is ignored on function pointer types.
|
||||
void (__attribute__((force_align_arg_pointer)) *p)();
|
||||
typedef void (__attribute__((__force_align_arg_pointer__)) *p2)();
|
||||
// Attribute is also ignored on function typedefs.
|
||||
typedef void __attribute__((force_align_arg_pointer)) e(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue