d: Merge upstream dmd 568496d5b, druntime 178c44ff, phobos 574bf883b.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / ddoc10.d
blob6a7a4812c602b358ade715df652f5710c032c1f1
1 // PERMUTE_ARGS:
2 // REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -o-
3 // POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh
5 // https://issues.dlang.org/show_bug.cgi?id=294
7 /// The foo
8 struct Foo(T) { }
9 /// ditto
10 struct Foo(T,U) { }
12 /** This basic case doesn't work very well. The template signature is
13 * documented twice, but the function signature (argument names and return
14 * type) is not documented at all. This comment is also repeated twice. */
15 int func1(T)(T x) {}
19 /** This comment is also repeated twice, and the second function signature is
20 * not very well documented. */
21 int func2(T,U)(T x, U y) {}
23 /// ditto
24 int func2(T)(T x) {}
26 /// Separate overload item.
27 int func2()() {}
30 ///
31 template func3(T,U) {
32 /** This used to work adequately and documented both func3 templates
33 * simultaneously. Now, it documents the first template twice and
34 * no longer documents the function argument and return types.*/
35 int func3(T x, U y) {}
38 /// ditto
39 deprecated template func3(T, U=int, V:long) {
40 private int func3(T x) {}
45 /**
46 * blah
49 void map(char rs)
53 /// Ditto
54 void map(int rs)
60 /**
61 * blah
64 void map2()(char rs)
68 /// Ditto
69 void map2()(int rs)
75 /**
76 * blah http://www.map3.com map3
79 void map3(char rs)
86 /**
87 * blah http://www.map.com map
90 void map4(string s)(char rs)
96 /**
97 * blah http://www.map.com map
100 template map5(string s)
105 /** blah */
106 struct bar6 {
107 int blah;
111 /** template bodies */
112 struct Foo7(T) {
114 /**Attempt one: Doc outside static if.*/
115 static if(is(T == uint)) {
116 /**Attempt two: Inside.*/
117 void bar() {}
119 else {
120 /**Attempt two: else.*/
121 void bar() {}
124 /** the abc function should be static */
125 static void abc() { }
129 /** show abstract */
130 abstract class Foo8 { }
132 /// a stray $(RPAREN) mustn't foul the macros
133 void bug4878(string a = ")") {}
135 /****
137 struct S
139 /****
141 this(long ticks) const pure nothrow { }
143 /****
145 pure nothrow this(this) { }
147 /****
149 const pure nothrow ~this() { }
151 /****
153 void foo(long ticks) const pure nothrow { }
157 /** Produces something in (a;b] */
158 float f10(float a, float b) { return (a+b)/2.0; }
159 /** Produces something in [a;b) */
160 float h10(float a, float b) { return (a+b)/2.0; }
164 void bug6090(string f="$(B b)", char g=')')(string h="$(", string i="$)") {}
167 /****
169 struct T
171 /****
173 this(A...)(A args) { }
176 this(int){}
180 // https://issues.dlang.org/show_bug.cgi?id=14547
182 /// doc-comment
183 int x14547 = 1;
185 /// ditto
186 enum int y14547 = 2;
188 /// doc-comment
189 enum isInt14547(T) = is(T == int);
191 /// ditto
192 enum bool isString14547(T) = is(T == string);
194 /// ditto
195 static immutable typeName14547(T) = T.stringof;
197 /// ditto
198 int storageFor14547(T) = 0;
200 /// doc-comment
201 template foo14547(T)
203 enum int foo14547 = T.stringof.length;
206 /// ditto
207 template bar14547(T) if (is(T == int))
209 enum int bar14547 = T.stringof.length;