1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Support for __builtin_types_compatible_p, bug 241570.

This commit is contained in:
Markus Schorn 2008-07-29 08:29:27 +00:00
parent 3a2809ae69
commit 5a6673a049
2 changed files with 12 additions and 0 deletions

View file

@ -5262,4 +5262,15 @@ public class AST2Tests extends AST2BaseTest {
bh.assertNonProblem("a3=", 2); bh.assertNonProblem("a3=", 2);
} }
} }
// void test() {
// char* p;
// if (__builtin_types_compatible_p(typeof(p), char[]))) {
// }
// }
public void testBuiltinTypesCompatible_bug241570() throws Exception {
for (ParserLanguage lang : ParserLanguage.values()) {
parseAndCheckBindings(getAboveComment(), lang, true);
}
}
} }

View file

@ -38,6 +38,7 @@ public abstract class GNUScannerExtensionConfiguration extends AbstractScannerEx
addMacro("__builtin_va_arg(ap,type)", "*(type *)ap"); addMacro("__builtin_va_arg(ap,type)", "*(type *)ap");
addMacro("__builtin_constant_p(exp)", "0"); addMacro("__builtin_constant_p(exp)", "0");
addMacro("__builtin_types_compatible_p(x,y)", "__builtin_types_compatible_p(sizeof(x),sizeof(y)");
addPreprocessorKeyword(Keywords.cINCLUDE_NEXT, IPreprocessorDirective.ppInclude_next); addPreprocessorKeyword(Keywords.cINCLUDE_NEXT, IPreprocessorDirective.ppInclude_next);
addPreprocessorKeyword(Keywords.cIMPORT, IPreprocessorDirective.ppImport); addPreprocessorKeyword(Keywords.cIMPORT, IPreprocessorDirective.ppImport);