[clang] 1896df1 - Correct the behavior of this test for non-Windows targets
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 3 06:00:13 PDT 2022
Author: Aaron Ballman
Date: 2022-06-03T09:00:05-04:00
New Revision: 1896df18cc5b588760f75cc2c21d64c772cf0e4c
URL: https://github.com/llvm/llvm-project/commit/1896df18cc5b588760f75cc2c21d64c772cf0e4c
DIFF: https://github.com/llvm/llvm-project/commit/1896df18cc5b588760f75cc2c21d64c772cf0e4c.diff
LOG: 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
Added:
Modified:
clang/test/C/drs/dr1xx.c
Removed:
################################################################################
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 at -2 {{invalid application of 'sizeof' to an incomplete type 'enum E'}} */
+ /* expected-note at -12 {{definition of 'enum E' is not complete until the closing '}'}} */
+ #endif
};
}
More information about the cfe-commits
mailing list