nested-incomplete-class.cpp 304 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -fsyntax-only %s
  2. template <typename T>
  3. struct foo {
  4. struct bar;
  5. bar fn() {
  6. // Should not get errors about bar being incomplete here.
  7. bar b = bar(1, 2);
  8. return b;
  9. }
  10. };
  11. template <typename T>
  12. struct foo<T>::bar {
  13. bar(int, int);
  14. };
  15. void fn() {
  16. foo<int>().fn();
  17. }