File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,31 @@ namespace GH97646 {
147
147
}
148
148
}
149
149
150
+ namespace GH99873 {
151
+ struct B {
152
+ int x;
153
+ };
154
+
155
+ template <typename T>
156
+ struct A {
157
+ template <typename U>
158
+ constexpr int f () const {
159
+ return 1 ;
160
+ }
161
+
162
+ template <>
163
+ constexpr int f<int >() const {
164
+ return decltype (B::x)();
165
+ }
166
+ };
167
+
168
+ // This shouldn't crash.
169
+ static_assert (A<int >().f<int >() == 0 , " " );
170
+ // The result should not be dependent.
171
+ static_assert (A<int >().f<int >() != 0 , " " ); // expected-error {{static assertion failed due to requirement 'GH99873::A<int>().f<int>() != 0'}}
172
+ // expected-note@-1 {{expression evaluates to '0 != 0'}}
173
+ }
174
+
150
175
template <typename >
151
176
class conditional {
152
177
};
You can’t perform that action at this time.
0 commit comments