diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/nestedtempl0.d')
-rw-r--r-- | gcc/testsuite/gdc.test/fail_compilation/nestedtempl0.d | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/nestedtempl0.d b/gcc/testsuite/gdc.test/fail_compilation/nestedtempl0.d new file mode 100644 index 00000000000..d323c34949c --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/nestedtempl0.d @@ -0,0 +1,35 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/nestedtempl0.d(18): Error: class `nestedtempl0.K.D!(1, B!(a)).D` doesn't need a frame pointer, but super class `B` needs the frame pointer of `main` +fail_compilation/nestedtempl0.d(28): Error: template instance `nestedtempl0.K.D!(1, B!(a))` error instantiating +fail_compilation/nestedtempl0.d(18): Error: class `nestedtempl0.main.fun.D!(b, B!(a)).D` needs the frame pointer of `fun`, but super class `B` needs the frame pointer of `main` +fail_compilation/nestedtempl0.d(33): Error: template instance `nestedtempl0.main.fun.D!(b, B!(a))` error instantiating +--- +*/ + +class K +{ + class B(alias a) + { + + } + + class D(alias a, T) : T + { + + } +} + +void main() +{ + int a; + auto k = new K; + auto d = k.new K.D!(1, K.B!a); + + auto fun() + { + int b; + auto o = k.new K.D!(b, K.B!a); + } +} |