mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 424378 - __is_final GCC built-in type trait is not supported
This commit is contained in:
parent
bff4a3bf6c
commit
240a5ac13e
7 changed files with 19 additions and 2 deletions
|
@ -152,6 +152,12 @@ public interface IASTTypeIdExpression extends IASTExpression {
|
|||
*/
|
||||
public static final int op_sizeofParameterPack = 22;
|
||||
|
||||
/**
|
||||
* Built-in type trait of g++.
|
||||
* @since 5.6
|
||||
*/
|
||||
public static final int op_is_final= 23;
|
||||
|
||||
/**
|
||||
* @deprecated constants should be declared here, to avoid using the same constant in different
|
||||
* interfaces.
|
||||
|
|
|
@ -106,7 +106,7 @@ public class GPPScannerExtensionConfiguration extends GNUScannerExtensionConfigu
|
|||
if (version >= VERSION_4_7) {
|
||||
addKeyword(GCCKeywords.cp__float128, IGCCToken.t__float128);
|
||||
addKeyword(GCCKeywords.cp__int128, IGCCToken.t__int128);
|
||||
|
||||
addKeyword(GCCKeywords.cp__is_final, IGCCToken.tTT_is_final);
|
||||
addKeyword(GCCKeywords.cp__underlying_type, IGCCToken.tTT_underlying_type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,5 +82,6 @@ public class GCCKeywords {
|
|||
|
||||
/** @since 5.6 */
|
||||
public static final char[]
|
||||
cp__is_final= "__is_final".toCharArray(),
|
||||
cp__underlying_type= "__underlying_type".toCharArray();
|
||||
}
|
||||
|
|
|
@ -48,5 +48,6 @@ public interface IGCCToken extends IToken {
|
|||
/** @since 5.5 */ int t__int128= FIRST_RESERVED_IGCCToken + 25;
|
||||
/** @since 5.5 */ int t__float128= FIRST_RESERVED_IGCCToken + 26;
|
||||
|
||||
/** @since 5.6 */ int tTT_underlying_type= FIRST_RESERVED_IGCCToken + 27;
|
||||
/** @since 5.6 */ int tTT_is_final= FIRST_RESERVED_IGCCToken + 27;
|
||||
/** @since 5.6 */ int tTT_underlying_type= FIRST_RESERVED_IGCCToken + 28;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_abstract;
|
|||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_class;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_empty;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_enum;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_final;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_literal_type;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_pod;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_polymorphic;
|
||||
|
@ -326,6 +327,8 @@ public class Value implements IValue {
|
|||
break; // TODO(sprigogin): Implement
|
||||
case op_is_enum:
|
||||
return type instanceof IEnumeration ? 1 : 0;
|
||||
case op_is_final:
|
||||
return type instanceof ICPPClassType && ((ICPPClassType) type).isFinal() ? 1 : 0;
|
||||
case op_is_literal_type:
|
||||
break; // TODO(sprigogin): Implement
|
||||
case op_is_pod:
|
||||
|
|
|
@ -1342,6 +1342,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
case IGCCToken.tTT_is_class:
|
||||
case IGCCToken.tTT_is_empty:
|
||||
case IGCCToken.tTT_is_enum:
|
||||
case IGCCToken.tTT_is_final:
|
||||
case IGCCToken.tTT_is_literal_type:
|
||||
case IGCCToken.tTT_is_pod:
|
||||
case IGCCToken.tTT_is_polymorphic:
|
||||
|
@ -1422,6 +1423,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return IASTTypeIdExpression.op_is_empty;
|
||||
case IGCCToken.tTT_is_enum:
|
||||
return IASTTypeIdExpression.op_is_enum;
|
||||
case IGCCToken.tTT_is_final:
|
||||
return IASTTypeIdExpression.op_is_final;
|
||||
case IGCCToken.tTT_is_literal_type:
|
||||
return IASTTypeIdExpression.op_is_literal_type;
|
||||
case IGCCToken.tTT_is_pod:
|
||||
|
|
|
@ -25,6 +25,7 @@ import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_abstract;
|
|||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_class;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_empty;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_enum;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_final;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_literal_type;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_pod;
|
||||
import static org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression.op_is_polymorphic;
|
||||
|
@ -109,6 +110,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
|||
case op_is_class:
|
||||
case op_is_empty:
|
||||
case op_is_enum:
|
||||
case op_is_final:
|
||||
case op_is_literal_type:
|
||||
case op_is_pod:
|
||||
case op_is_polymorphic:
|
||||
|
@ -150,6 +152,7 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
|||
case op_is_class:
|
||||
case op_is_empty:
|
||||
case op_is_enum:
|
||||
case op_is_final:
|
||||
case op_is_literal_type:
|
||||
case op_is_pod:
|
||||
case op_is_polymorphic:
|
||||
|
|
Loading…
Add table
Reference in a new issue