Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-11-18 00:47:16 +0000
committerNathan Ridge2018-11-24 20:53:17 +0000
commitd085e955c72e7ce382620a78dee2643e093d9d96 (patch)
tree724eba2d366f1af7551fb3edae70d4903c673c75
parent86b8f216235b208604ba1cc6ac20d49fc5c9eced (diff)
downloadorg.eclipse.cdt-d085e955c72e7ce382620a78dee2643e093d9d96.tar.gz
org.eclipse.cdt-d085e955c72e7ce382620a78dee2643e093d9d96.tar.xz
org.eclipse.cdt-d085e955c72e7ce382620a78dee2643e093d9d96.zip
Bug 540991 - Handle ICPPASTTypeTransformationSpecifier in CModelBuilder2
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTStringUtil.java12
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java5
2 files changed, 17 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTStringUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTStringUtil.java
index 42c8c51920d..a8bb67cfdd5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTStringUtil.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTStringUtil.java
@@ -79,6 +79,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplatedTypeTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeIdExpression;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeTransformationSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUnaryExpression;
import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression;
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
@@ -698,6 +699,17 @@ public class ASTStringUtil {
} else if (declSpecifier instanceof IASTNamedTypeSpecifier) {
final IASTNamedTypeSpecifier namedTypeSpec = (IASTNamedTypeSpecifier) declSpecifier;
appendQualifiedNameString(buffer, namedTypeSpec.getName());
+ } else if (declSpecifier instanceof ICPPASTTypeTransformationSpecifier) {
+ final ICPPASTTypeTransformationSpecifier typeTransformationSpec = (ICPPASTTypeTransformationSpecifier) declSpecifier;
+ switch (typeTransformationSpec.getOperator()) {
+ case underlying_type:
+ buffer.append(GCCKeywords.cp__underlying_type);
+ break;
+ default:
+ }
+ buffer.append('(');
+ appendTypeIdString(buffer, typeTransformationSpec.getOperand());
+ buffer.append(')');
}
return buffer;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
index a8749c1b251..63c983b1b11 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
@@ -67,6 +67,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTStaticAssertDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateSpecialization;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTypeTransformationSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDirective;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
@@ -491,6 +492,10 @@ public class CModelBuilder2 implements IContributedModelBuilder {
if (declarator != null) {
return createTypedefOrFunctionOrVariable(parent, declSpecifier, declarator, isTemplate);
}
+ } else if (declSpecifier instanceof ICPPASTTypeTransformationSpecifier) {
+ if (declarator != null) {
+ return createTypedefOrFunctionOrVariable(parent, declSpecifier, declarator, isTemplate);
+ }
} else {
assert false : "TODO: " + declSpecifier.getClass().getName(); //$NON-NLS-1$
}

Back to the top