|
2 | 2 |
|
3 | 3 | template <class T> struct A {
|
4 | 4 | static T cond;
|
5 |
| - |
| 5 | + |
6 | 6 | template <class U> struct B {
|
7 | 7 | static T twice(U value) {
|
8 | 8 | return (cond ? value + value : value);
|
@@ -53,7 +53,7 @@ namespace OutOfLine {
|
53 | 53 | static int x<U*, V>;
|
54 | 54 |
|
55 | 55 | template<typename U, B V>
|
56 |
| - static constexpr int x<U&, V> = 0; // expected-note {{previous definition is here}} |
| 56 | + static inline int x<U&, V> = 0; // expected-note {{previous definition is here}} |
57 | 57 |
|
58 | 58 | template<typename U, B V>
|
59 | 59 | struct C;
|
@@ -83,7 +83,7 @@ namespace OutOfLine {
|
83 | 83 |
|
84 | 84 | template<typename T>
|
85 | 85 | template<typename U, typename A<T>::B V>
|
86 |
| - constexpr int A<T>::x<U&, V> = 0; // expected-error {{redefinition of 'x<U &, V>'}} |
| 86 | + int A<T>::x<U&, V> = 0; // expected-error {{redefinition of 'x<U &, V>'}} |
87 | 87 |
|
88 | 88 | template<typename T>
|
89 | 89 | template<typename U, typename A<T>::B V>
|
@@ -120,12 +120,11 @@ namespace OutOfLine {
|
120 | 120 |
|
121 | 121 | template<>
|
122 | 122 | template<typename U, A<int>::B V>
|
123 |
| - constexpr int A<int>::x<U&, V> = 0; |
| 123 | + int A<int>::x<U&, V> = 0; // expected-note {{previous definition is here}} |
124 | 124 |
|
125 |
| - // FIXME: We should diagnose this redefinition! |
126 | 125 | template<>
|
127 | 126 | template<typename U, A<int>::B V>
|
128 |
| - constexpr int A<int>::x<U&, V> = 0; |
| 127 | + int A<int>::x<U&, V> = 0; // expected-error {{redefinition of 'x<U &, V>'}} |
129 | 128 |
|
130 | 129 | template<>
|
131 | 130 | template<typename U, A<int>::B V>
|
|
0 commit comments