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:
Charles Davis 2010-02-18 04:56:59 +00:00
parent c451027db9
commit 9fcead75ee
2 changed files with 4 additions and 1 deletions

View File

@ -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)) {

View File

@ -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);