mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Revert "Bug 451091 - Make type of constexpr variable const-qualified"
This reverts commit 39dce1d497
.
This commit is contained in:
parent
a79825be23
commit
a830f285fe
2 changed files with 1 additions and 12 deletions
|
@ -10978,12 +10978,4 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0];
|
||||
isParameterSignatureEqual(sd.getDeclarators()[0], "(int&&)");
|
||||
}
|
||||
|
||||
// constexpr int waldo = 42;
|
||||
public void testConstexprVariableIsConst_451091() throws Exception {
|
||||
BindingAssertionHelper helper = getAssertionHelper();
|
||||
ICPPVariable waldo = helper.assertNonProblem("waldo");
|
||||
assertInstance(waldo.getType(), IQualifierType.class);
|
||||
assertTrue(((IQualifierType) waldo.getType()).isConst());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2240,10 +2240,7 @@ public class CPPVisitor extends ASTQueries {
|
|||
}
|
||||
|
||||
private static IType qualifyType(IType type, IASTDeclSpecifier declSpec) {
|
||||
boolean isConst = declSpec.isConst()
|
||||
|| (declSpec instanceof ICPPASTDeclSpecifier
|
||||
&& ((ICPPASTDeclSpecifier) declSpec).isConstexpr());
|
||||
return SemanticUtil.addQualifiers(type, isConst, declSpec.isVolatile(), declSpec.isRestrict());
|
||||
return SemanticUtil.addQualifiers(type, declSpec.isConst(), declSpec.isVolatile(), declSpec.isRestrict());
|
||||
}
|
||||
|
||||
private static IType createType(IType baseType, IASTDeclarator declarator) {
|
||||
|
|
Loading…
Add table
Reference in a new issue