initial commit

This commit is contained in:
2026-07-18 20:34:55 +02:00
commit 59ad004c96
474 changed files with 226635 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#include "ambiguousoverload.h"
/**
* Regression test for function pointers in aggregate initialisers.
*
* This setup function must be in a different translation unit from clearView's definition and
* direct call (ambiguousoverload_trigger.c). The bug reused clearView's function declaration as an
* aggregate-initialiser list node and corrupted its overload chain. Parsing the definition in the
* other translation unit then made the otherwise unambiguous direct call fail.
*
* Holder reproduces the original ambiguous-overload diagnostic. The single-member CallbackHolder
* also covers the related initialiser-builder assertion. Both callbacks are invoked to verify that
* their aggregate initialisers contain the correct function address. The pragma in
* ambiguousoverload.h schedules the companion translation unit so this remains one autotest target.
*/
void setup(void)
{
struct Holder holder = { .value = 1, .callback = clearView };
struct CallbackHolder callbackHolder = { .callback = clearView };
holder.callback();
callbackHolder.callback();
}