xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/nested-incomplete-class.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc template <typename T>
4*f4a2713aSLionel Sambuc struct foo {
5*f4a2713aSLionel Sambuc   struct bar;
6*f4a2713aSLionel Sambuc 
fnfoo7*f4a2713aSLionel Sambuc   bar fn() {
8*f4a2713aSLionel Sambuc     // Should not get errors about bar being incomplete here.
9*f4a2713aSLionel Sambuc     bar b = bar(1, 2);
10*f4a2713aSLionel Sambuc     return b;
11*f4a2713aSLionel Sambuc   }
12*f4a2713aSLionel Sambuc };
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc template <typename T>
15*f4a2713aSLionel Sambuc struct foo<T>::bar {
16*f4a2713aSLionel Sambuc   bar(int, int);
17*f4a2713aSLionel Sambuc };
18*f4a2713aSLionel Sambuc 
fn()19*f4a2713aSLionel Sambuc void fn() {
20*f4a2713aSLionel Sambuc   foo<int>().fn();
21*f4a2713aSLionel Sambuc }
22