Commit 8634ef1
authored
Add [[nodiscard]] attribute (#8462)
This PR adds support for the `[[nodiscard]]` attribute so that
diagnostics can be easily issued for cases where return types of
functions should not be discarded.
This came up in feedback about the `Matrix::Fill` function in the linear
algebra specification.1 parent 14696d1 commit 8634ef1
7 files changed
Lines changed: 56 additions & 8 deletions
File tree
- tools/clang
- include/clang
- AST
- Basic
- lib
- AST
- Headers/hlsl/dx
- Sema
- test/SemaHLSL/attributes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2079 | 2079 | | |
2080 | 2080 | | |
2081 | 2081 | | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
2082 | 2086 | | |
2083 | 2087 | | |
2084 | 2088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2470 | 2470 | | |
2471 | 2471 | | |
2472 | 2472 | | |
| 2473 | + | |
2473 | 2474 | | |
2474 | | - | |
| 2475 | + | |
2475 | 2476 | | |
2476 | 2477 | | |
2477 | 2478 | | |
2478 | 2479 | | |
2479 | 2480 | | |
| 2481 | + | |
2480 | 2482 | | |
2481 | 2483 | | |
2482 | 2484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6368 | 6368 | | |
6369 | 6369 | | |
6370 | 6370 | | |
6371 | | - | |
6372 | | - | |
6373 | | - | |
| 6371 | + | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
6374 | 6376 | | |
6375 | 6377 | | |
6376 | 6378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2884 | 2884 | | |
2885 | 2885 | | |
2886 | 2886 | | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
2887 | 2901 | | |
2888 | 2902 | | |
2889 | 2903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
| |||
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
273 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
274 | 281 | | |
275 | 282 | | |
276 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments