summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/static-data-member.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/static-data-member.cpp')
-rw-r--r--test/SemaCXX/static-data-member.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/static-data-member.cpp b/test/SemaCXX/static-data-member.cpp
new file mode 100644
index 0000000..9fe87b1
--- /dev/null
+++ b/test/SemaCXX/static-data-member.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -w %s
+
+struct ABC {
+ static double a;
+ static double b;
+ static double c;
+ static double d;
+ static double e;
+ static double f;
+};
+
+double ABC::a = 1.0;
+extern double ABC::b = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+static double ABC::c = 1.0; // expected-error {{'static' can only be specified inside the class definition}}
+__private_extern__ double ABC::d = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+auto double ABC::e = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+register double ABC::f = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
OpenPOWER on IntegriCloud