instantiate-deeply.cpp 673 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // RUN: %clang_cc1 -fsyntax-only -Wall -verify %s
  2. // expected-no-diagnostics
  3. template<typename a> struct A {
  4. template <typename b> struct B {
  5. template <typename c> struct C {
  6. template <typename d> struct D {
  7. template <typename e> struct E {
  8. e field;
  9. E() : field(0) {
  10. d v1 = 4;
  11. c v2 = v1 * v1;
  12. b v3 = 8;
  13. a v4 = v3 * v3;
  14. field += v2 + v4;
  15. }
  16. };
  17. };
  18. };
  19. };
  20. };
  21. A<int>::B<int>::C<int>::D<int>::E<int> global;
  22. // PR5352
  23. template <typename T>
  24. class Foo {
  25. public:
  26. Foo() {}
  27. struct Bar {
  28. T value;
  29. };
  30. Bar u;
  31. };
  32. template class Foo<int>;