From 1896df18cc5b588760f75cc2c21d64c772cf0e4c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 3 Jun 2022 08:59:00 -0400 Subject: [PATCH] Correct the behavior of this test for non-Windows targets This should address build failures like: https://lab.llvm.org/buildbot/#/builders/188/builds/14980 https://lab.llvm.org/buildbot/#/builders/171/builds/15515 https://lab.llvm.org/buildbot/#/builders/91/builds/9877 --- clang/test/C/drs/dr1xx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clang/test/C/drs/dr1xx.c b/clang/test/C/drs/dr1xx.c index 10497f90c2db..e7343c0e3573 100644 --- a/clang/test/C/drs/dr1xx.c +++ b/clang/test/C/drs/dr1xx.c @@ -177,8 +177,16 @@ void dr118(void) { /* The enum isn't a complete type until the closing }, but an * implementation may complete the type earlier if it has sufficient type * information to calculate size or alignment, etc. + * + * On Microsoft targets, an enum is always implicit int sized, so the type + * is sufficiently complete there. On other platforms, it is an incomplete + * type at this point. */ Val = sizeof(enum E) + #ifndef _WIN32 + /* expected-error@-2 {{invalid application of 'sizeof' to an incomplete type 'enum E'}} */ + /* expected-note@-12 {{definition of 'enum E' is not complete until the closing '}'}} */ + #endif }; }