summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/class/class.static/class.static.data/p4.cpp9
-rw-r--r--clang/test/CXX/drs/dr0xx.cpp5
-rw-r--r--clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp8
3 files changed, 10 insertions, 12 deletions
diff --git a/clang/test/CXX/class/class.static/class.static.data/p4.cpp b/clang/test/CXX/class/class.static/class.static.data/p4.cpp
index 2b1eca74193..85d18c6b5fa 100644
--- a/clang/test/CXX/class/class.static/class.static.data/p4.cpp
+++ b/clang/test/CXX/class/class.static/class.static.data/p4.cpp
@@ -10,15 +10,14 @@ struct OutOfClassInitializerOnly {
int const OutOfClassInitializerOnly::i = 0;
struct InClassInitializerAndOutOfClassCopyInitializer {
- static const int i = 0; // expected-note{{previous definition is here}}
+ static const int i = 0; // expected-note{{previous initialization is here}}
};
-int const InClassInitializerAndOutOfClassCopyInitializer::i = 0; // expected-error{{redefinition of 'i'}}
+int const InClassInitializerAndOutOfClassCopyInitializer::i = 0; // expected-error{{static data member 'i' already has an initializer}}
struct InClassInitializerAndOutOfClassDirectInitializer {
- static const int i = 0; // expected-note{{previous definition is here}}
+ static const int i = 0; // expected-note{{previous initialization is here}}
};
-int const InClassInitializerAndOutOfClassDirectInitializer::i(0); // expected-error{{redefinition of 'i'}}
-
+int const InClassInitializerAndOutOfClassDirectInitializer::i(0); // expected-error{{static data member 'i' already has an initializer}}
int main() { }
diff --git a/clang/test/CXX/drs/dr0xx.cpp b/clang/test/CXX/drs/dr0xx.cpp
index 265a52d9261..57e3a754c54 100644
--- a/clang/test/CXX/drs/dr0xx.cpp
+++ b/clang/test/CXX/drs/dr0xx.cpp
@@ -919,11 +919,10 @@ namespace dr87 { // dr87: no
namespace dr88 { // dr88: yes
template<typename T> struct S {
- static const int a = 1;
+ static const int a = 1; // expected-note {{previous}}
static const int b;
};
- // FIXME: This diagnostic is pretty bad.
- template<> const int S<int>::a = 4; // expected-error {{redefinition}} expected-note {{previous}}
+ template<> const int S<int>::a = 4; // expected-error {{already has an initializer}}
template<> const int S<int>::b = 4;
}
diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
index 94d0f16f06e..1e959364280 100644
--- a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
+++ b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
@@ -39,11 +39,11 @@ namespace out_of_line {
template<typename T> CONST T B1::right<T,int> = T(5);
class B2 {
- template<typename T, typename T0> static CONST T right = T(100); // expected-note {{previous definition is here}}
- template<typename T> static CONST T right<T,int> = T(5); // expected-note {{previous definition is here}}
+ template<typename T, typename T0> static CONST T right = T(100); // expected-note {{previous initialization is here}}
+ template<typename T> static CONST T right<T,int> = T(5); // expected-note {{previous initialization is here}}
};
- template<typename T, typename T0> CONST T B2::right = T(100); // expected-error {{redefinition of 'right'}}
- template<typename T> CONST T B2::right<T,int> = T(5); // expected-error {{redefinition of 'right'}}
+ template<typename T, typename T0> CONST T B2::right = T(100); // expected-error {{static data member 'right' already has an initializer}}
+ template<typename T> CONST T B2::right<T,int> = T(5); // expected-error {{static data member 'right' already has an initializer}}
class B3 {
template<typename T, typename T0> static CONST T right = T(100);
OpenPOWER on IntegriCloud