Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c
index d03ada8..a0f15e9 100644
--- a/test/Parser/MicrosoftExtensions.c
+++ b/test/Parser/MicrosoftExtensions.c
@@ -11,11 +11,11 @@
void * __ptr64 PtrToPtr64(const void *p)
{
- return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
+ return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p ); // expected-warning {{unknown attribute '__ptr64' ignored}}
}
void * __ptr32 PtrToPtr32(const void *p)
{
- return((void * __ptr32) (unsigned __int32) (ULONG_PTR)p );
+ return((void * __ptr32) (unsigned __int32) (ULONG_PTR)p ); // expected-warning {{unknown attribute '__ptr32' ignored}}
}
void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
diff --git a/test/Sema/types.c b/test/Sema/types.c
index f3244f7..33305ab 100644
--- a/test/Sema/types.c
+++ b/test/Sema/types.c
@@ -37,3 +37,7 @@
// rdar://6880951
int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector element type}}
+
+void test(int i) {
+ char c = (char __attribute__((align(8)))) i; // expected-error {{'align' attribute ignored when parsing type}}
+}