]> granicus.if.org Git - clang/commitdiff
Adding some more specific tests for enum declspec parsing, to prove that it really...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 15 Mar 2012 00:20:05 +0000 (00:20 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 15 Mar 2012 00:20:05 +0000 (00:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152757 91177308-0d34-0410-b5e6-96231b3b80d8

test/Parser/MicrosoftExtensions.c

index 5f457293faef1c09b24528e1c39a20eddf43d81a..1ef326aaf5d3574f1b12c58c86b4cb4aa8d4f222 100644 (file)
@@ -52,6 +52,13 @@ typedef enum E { e1 };
 enum __declspec(deprecated) E2 { i, j, k };
 __declspec(deprecated) enum E3 { a, b, c } e;
 
+void deprecated_enum_test(void)
+{
+  // Test to make sure the deprecated warning follows the right thing
+  enum E2 e1;  // expected-warning {{'E2' is deprecated}}
+  enum E3 e2; // No warning expected, the deprecation follows the variable
+  enum E3 e3 = e;  // expected-warning {{'e' is deprecated}}
+}
 
 /* Microsoft attribute tests */
 [repeatable][source_annotation_attribute( Parameter|ReturnValue )]