You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
535 B

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
struct Y {
int y();
};
template <typename T>
struct X {
struct Y;
int x_y() {
struct Y y;
return y.y();
}
};
template <typename T>
struct Z {
int z() { return 3; };
};
template <typename T>
struct X<T>::Y : Z<T> {
int y() { return Y::z() - 3; }
};
void instantiate_class_bad() {
struct X<int> x;
int n = 1 / x.x_y();
}