diff options
author | Charles Davis <cdavis@mines.edu> | 2010-02-18 04:56:59 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2010-02-18 04:56:59 +0000 |
commit | e01c063874fa762abfba03b920bca16e1a1f10b4 (patch) | |
tree | d694805faf39df408c04a64c51e97ba731c34dd9 | |
parent | beaf5edfb22dd36b3d0e526291fd3a074404dd3e (diff) |
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.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96570 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/TargetAttributesSema.cpp | 3 | ||||
-rw-r--r-- | test/Sema/x86-attr-force-align-arg-pointer.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp index 1ea0299103..35e42fb696 100644 --- a/lib/Sema/TargetAttributesSema.cpp +++ b/lib/Sema/TargetAttributesSema.cpp @@ -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)) { diff --git a/test/Sema/x86-attr-force-align-arg-pointer.c b/test/Sema/x86-attr-force-align-arg-pointer.c index 5c7582fe0f..b406a77e04 100644 --- a/test/Sema/x86-attr-force-align-arg-pointer.c +++ b/test/Sema/x86-attr-force-align-arg-pointer.c @@ -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); |