mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
Bug 475739 - Follow-up to fix some warnings related to deprecation
Change-Id: I400de3448d615cef6adea5035ed24e66490819d4 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
fe5aea4644
commit
ad2940f594
3 changed files with 28 additions and 9 deletions
|
@ -56,7 +56,8 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get any alignment-specifiers in this decl-specifier sequence.
|
* Get any alignment-specifiers in this decl-specifier sequence.
|
||||||
* @deprecated Alignment specifiers are now stored in the attribute specifier sequence.
|
* @deprecated Use ICASTDeclSpecifier.getAlignmentSpecifiers() for C code.
|
||||||
|
* In C++ code, alignment specifiers are now stored in the attribute specifier sequence.
|
||||||
* @since 5.10
|
* @since 5.10
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -102,7 +103,8 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not allowed on frozen ast.
|
* Not allowed on frozen ast.
|
||||||
* @deprecated Alignment specifiers are now stored in the attribute specifier sequence.
|
* @deprecated Use ICASTDeclSpecifier.setAlignmentSpecifiers() for C code.
|
||||||
|
* In C++ code, alignment specifiers are now stored in the attribute specifier sequence.
|
||||||
* @since 5.10
|
* @since 5.10
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast.c;
|
package org.eclipse.cdt.core.dom.ast.c;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTAlignmentSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,9 +22,21 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ICASTDeclSpecifier extends IASTDeclSpecifier {
|
public interface ICASTDeclSpecifier extends IASTDeclSpecifier {
|
||||||
|
/**
|
||||||
|
* @since 5.12
|
||||||
|
*/
|
||||||
|
public static final ASTNodeProperty ALIGNMENT_SPECIFIER = new ASTNodeProperty(
|
||||||
|
"ICASTDeclSpecifier.ALIGNMENT_SPECIFIER - Alignment specifier"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ICASTDeclSpecifier copy();
|
public ICASTDeclSpecifier copy();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IASTAlignmentSpecifier[] getAlignmentSpecifiers();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAlignmentSpecifiers(IASTAlignmentSpecifier[] alignmentSpecifiers);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,11 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayDesignator;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayDesignator;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.c.ICASTEnumerationSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTFieldDesignator;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTFieldDesignator;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTSimpleDeclSpecifier;
|
||||||
|
@ -920,8 +923,8 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
int isLong= 0;
|
int isLong= 0;
|
||||||
|
|
||||||
IToken returnToken= null;
|
IToken returnToken= null;
|
||||||
IASTDeclSpecifier result= null;
|
ICASTDeclSpecifier result= null;
|
||||||
IASTDeclSpecifier altResult= null;
|
ICASTDeclSpecifier altResult= null;
|
||||||
IASTAlignmentSpecifier[] alignmentSpecifiers = IASTAlignmentSpecifier.EMPTY_ALIGNMENT_SPECIFIER_ARRAY;
|
IASTAlignmentSpecifier[] alignmentSpecifiers = IASTAlignmentSpecifier.EMPTY_ALIGNMENT_SPECIFIER_ARRAY;
|
||||||
try {
|
try {
|
||||||
IASTName identifier= null;
|
IASTName identifier= null;
|
||||||
|
@ -1131,10 +1134,10 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
if (encounteredTypename || encounteredRawType)
|
if (encounteredTypename || encounteredRawType)
|
||||||
break declSpecifiers;
|
break declSpecifiers;
|
||||||
try {
|
try {
|
||||||
result= enumSpecifier();
|
result= (ICASTEnumerationSpecifier) enumSpecifier();
|
||||||
} catch (BacktrackException bt) {
|
} catch (BacktrackException bt) {
|
||||||
if (bt.getNodeBeforeProblem() instanceof IASTDeclSpecifier) {
|
if (bt.getNodeBeforeProblem() instanceof ICASTDeclSpecifier) {
|
||||||
result= (IASTDeclSpecifier) bt.getNodeBeforeProblem();
|
result= (ICASTDeclSpecifier) bt.getNodeBeforeProblem();
|
||||||
problem = bt.getProblem();
|
problem = bt.getProblem();
|
||||||
break declSpecifiers;
|
break declSpecifiers;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1323,7 +1326,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IASTElaboratedTypeSpecifier elaboratedTypeSpecifier() throws BacktrackException, EndOfFileException {
|
protected ICASTElaboratedTypeSpecifier elaboratedTypeSpecifier() throws BacktrackException, EndOfFileException {
|
||||||
// this is an elaborated class specifier
|
// this is an elaborated class specifier
|
||||||
IToken t = consume();
|
IToken t = consume();
|
||||||
int eck = 0;
|
int eck = 0;
|
||||||
|
@ -1347,7 +1350,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
__attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
|
__attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
|
||||||
|
|
||||||
IASTName name = identifier();
|
IASTName name = identifier();
|
||||||
IASTElaboratedTypeSpecifier result = getNodeFactory().newElaboratedTypeSpecifier(eck, name);
|
ICASTElaboratedTypeSpecifier result = getNodeFactory().newElaboratedTypeSpecifier(eck, name);
|
||||||
((ASTNode) result).setOffsetAndLength(t.getOffset(), calculateEndOffset(name) - t.getOffset());
|
((ASTNode) result).setOffsetAndLength(t.getOffset(), calculateEndOffset(name) - t.getOffset());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue