diff options
author | Joseph Henry | 2016-06-06 13:26:48 +0000 |
---|---|---|
committer | Nathan Ridge | 2017-01-21 20:19:14 +0000 |
commit | 785f442ee19fd496f712f3ebc5412448f6c52807 (patch) | |
tree | c698c40aba80e511a774770fb3d5b60c2249da0a /core/org.eclipse.cdt.core/parser/org/eclipse/cdt | |
parent | db3d5974e66ac443ee773e062f62fe8537933f3c (diff) | |
download | org.eclipse.cdt-785f442ee19fd496f712f3ebc5412448f6c52807.tar.gz org.eclipse.cdt-785f442ee19fd496f712f3ebc5412448f6c52807.tar.xz org.eclipse.cdt-785f442ee19fd496f712f3ebc5412448f6c52807.zip |
Bug 495423 - Indexer produces a erroneous "Symbol could not be found"
Added catch all condition to ConditionalExpression type evaluation where
both positive and negative types are the same.
Change-Id: I990b502dfce8ef71c753ac188e072de312b7ea9f
Signed-off-by: Joseph Henry <joseph.henry@sas.com>
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt')
-rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTConditionalExpression.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTConditionalExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTConditionalExpression.java index b76ceb58be4..410dd600bb7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTConditionalExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTConditionalExpression.java @@ -172,6 +172,10 @@ public class CASTConditionalExpression extends ASTNode implements private IType computeResultType(IASTExpression positiveExpression, IASTExpression negativeExpression, IType positiveType, IType negativeType) { + // Unwrap any top-level cv-qualifiers. + positiveType = CVisitor.unwrapCV(positiveType); + negativeType = CVisitor.unwrapCV(negativeType); + // [6.5.15] p5: If both the second and third operands have arithmetic type, the result type // that would be determined by the usual arithmetic conversions, were they applied to those // two operands, is the type of the result. If both operands have void type, the result has @@ -222,7 +226,7 @@ public class CASTConditionalExpression extends ASTNode implements return new CPointerType( ExpressionTypes.restoreCV(resultPointee, positivePointeeCV, negativePointeeCV), 0); } - + return null; } |