| 1 |
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
/* WG14 N3262: Yes |
| 5 |
* Usability of a byte-wise copy of va_list |
| 6 |
* |
| 7 |
* NB: Clang explicitly documents this as being undefined behavior. A |
| 8 |
* diagnostic is produced for some targets but not for others for assignment or |
| 9 |
* initialization, but no diagnostic is possible to produce for use with memcpy |
| 10 |
* in the general case, nor with a manual bytewise copy via a for loop. |
| 11 |
* |
| 12 |
* Therefore, nothing is tested in this file; it serves as a reminder that we |
| 13 |
* validated our documentation against the paper. See |
| 14 |
* clang/docs/LanguageExtensions.rst for more details. |
| 15 |
* |
| 16 |
* FIXME: it would be nice to add ubsan support for recognizing when an invalid |
| 17 |
* copy is made and diagnosing on copy (or on use of the copied va_list). |
| 18 |
*/ |
| 19 |
|
| 20 |
int main() {} |