summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/ast-print.c5
-rw-r--r--clang/test/SemaCXX/MicrosoftCompatibility.cpp9
2 files changed, 12 insertions, 2 deletions
diff --git a/clang/test/Sema/ast-print.c b/clang/test/Sema/ast-print.c
index 92b317e00b0..7f675206e58 100644
--- a/clang/test/Sema/ast-print.c
+++ b/clang/test/Sema/ast-print.c
@@ -4,6 +4,8 @@
// RUN: echo >> %t.c "// expected""-warning@* {{use of GNU old-style field designator extension}}"
// RUN: echo >> %t.c "// expected""-warning@* {{'EnumWithAttributes' is deprecated}}"
// RUN: echo >> %t.c "// expected""-note@* {{'EnumWithAttributes' has been explicitly marked deprecated here}}"
+// RUN: echo >> %t.c "// expected""-warning@* {{'EnumWithAttributes2' is deprecated}}"
+// RUN: echo >> %t.c "// expected""-note@* {{'EnumWithAttributes2' has been explicitly marked deprecated here}}"
// RUN: echo >> %t.c "// expected""-warning@* {{'EnumWithAttributes3' is deprecated}}"
// RUN: echo >> %t.c "// expected""-note@* {{'EnumWithAttributes3' has been explicitly marked deprecated here}}"
// RUN: %clang_cc1 -fsyntax-only %t.c -verify
@@ -86,8 +88,7 @@ enum EnumWithAttributes { // expected-warning {{'EnumWithAttributes' is deprecat
// CHECK-NEXT: } *EnumWithAttributesPtr;
} __attribute__((deprecated)) *EnumWithAttributesPtr; // expected-note {{'EnumWithAttributes' has been explicitly marked deprecated here}}
-// FIXME: If enum is forward-declared at file scope, attributes are lost.
-// CHECK-LABEL: enum EnumWithAttributes2 *EnumWithAttributes2Ptr;
+// CHECK-LABEL: enum __attribute__((deprecated(""))) EnumWithAttributes2 *EnumWithAttributes2Ptr;
// expected-warning@+2 {{'EnumWithAttributes2' is deprecated}}
// expected-note@+1 {{'EnumWithAttributes2' has been explicitly marked deprecated here}}
enum __attribute__((deprecated)) EnumWithAttributes2 *EnumWithAttributes2Ptr;
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
index d095f6edc61..203a8101114 100644
--- a/clang/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/clang/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -239,6 +239,15 @@ enum ENUM2 {
ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
};
+namespace NsEnumForwardDecl {
+ enum E *p; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
+ extern E e;
+}
+// Clang used to complain that NsEnumForwardDecl::E was undeclared below.
+NsEnumForwardDecl::E NsEnumForwardDecl_e;
+namespace NsEnumForwardDecl {
+ extern E e;
+}
namespace PR11791 {
template<class _Ty>
OpenPOWER on IntegriCloud