1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 02:35:37 +02:00

Bug 487972 - Unnecessary inclusion of <cstdbool>

Change-Id: I3f8b9cd157107f81a46e26c0966ce551772fb5ec
This commit is contained in:
Sergey Prigogin 2016-02-17 18:48:20 -08:00
parent 1a4e98b866
commit f4cb39bc3b
2 changed files with 16 additions and 1 deletions

View file

@ -436,6 +436,7 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
// }; // };
public void testFieldReference_487971() throws Exception { public void testFieldReference_487971() throws Exception {
assertDefined("A", "B"); assertDefined("A", "B");
assertDeclared();
} }
// typedef unsigned int size_t; // typedef unsigned int size_t;
@ -725,4 +726,13 @@ public class BindingClassifierTest extends OneSourceMultipleHeadersTestCase {
assertDefined("MACRO"); assertDefined("MACRO");
assertDeclared(); assertDeclared();
} }
// #define bool bool
// #define false false
// bool b = false;
public void testIdentityMacro_487972() throws Exception {
assertDefined();
assertDeclared();
}
} }

View file

@ -74,6 +74,7 @@ import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration; import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.IFunctionType; import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IMacroBinding;
import org.eclipse.cdt.core.dom.ast.IParameter; import org.eclipse.cdt.core.dom.ast.IParameter;
import org.eclipse.cdt.core.dom.ast.IPointerType; import org.eclipse.cdt.core.dom.ast.IPointerType;
import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IProblemBinding;
@ -858,7 +859,11 @@ public class BindingClassifier {
for (IASTPreprocessorMacroExpansion macroExpansion : tu.getMacroExpansions()) { for (IASTPreprocessorMacroExpansion macroExpansion : tu.getMacroExpansions()) {
IASTPreprocessorMacroDefinition macroDefinition = macroExpansion.getMacroDefinition(); IASTPreprocessorMacroDefinition macroDefinition = macroExpansion.getMacroDefinition();
IASTName name = macroDefinition.getName(); IASTName name = macroDefinition.getName();
defineBinding(name.getBinding()); IMacroBinding macroBinding = (IMacroBinding) name.getBinding();
// Ignore trivial macros like '#define false false'
if (!CharArrayUtils.equals(name.getSimpleID(), macroBinding.getExpansion())) {
defineBinding(macroBinding);
}
} }
return PROCESS_CONTINUE; return PROCESS_CONTINUE;
} }