Closed
Description
By default on Windows, Clang 11 injects an implicit struct _GUID
declaration into every translation unit; this is new since Clang 9. This declaration has an invalid source location, so it causes an assertion failure in DeclRewriter::detectInlineStruct in 129 of our regression tests. We should probably just skip inline struct detection if the struct source location is invalid.
While the struct _GUID
injection is enabled by default only on Windows, we can enable it on other OSes for testing purposes using the -fms-extensions
compiler option. Thus, 3c ms-extensions.c -- -fms-extensions
reproduces the problem if ms-extensions.c
contains:
int *x;
Some options for testing:
- Just add the above as a regression test.
- Add an
-fms-extensions
regression test containing a manually curated wider variety of constructs. - Develop a convenient way to run the entire regression test with
-fms-extensions
(likely easier with Refactor testRUN
commands into a separate tool #355) and do that occasionally (we probably don't want to spend the time to run it on every change). - Just rely on real testing on Windows to catch issues with
-fms-extensions
and anything else that differs on Windows.
I'm not sure which one offers the best trade-off between value and work.
Metadata
Metadata
Assignees
Labels
No labels