diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index d5c1d13ea53..7715e9b7b6b 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -10731,4 +10731,11 @@ public class AST2CPPTests extends AST2TestBase { ICPPFunction operator = helper.assertNonProblem("operator()"); assertEquals(operator, call2.getOverload()); } + + // void f(int &&a); + public void testRValueReferenceSignature_427856() throws Exception { + IASTTranslationUnit tu = parseAndCheckBindings(); + IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0]; + isParameterSignatureEqual(sd.getDeclarators()[0], "(int&&)"); + } } 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 e6e5da5d3f2..ec8fec08071 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 @@ -9,6 +9,7 @@ * Anton Leherbauer (Wind River Systems) - initial API and implementation * Markus Schorn (Wind River Systems) * Sergey Prigogin (Google) + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.internal.core.model; @@ -454,7 +455,11 @@ public class ASTStringUtil { buffer.append(' ').append(Keywords.RESTRICT); } } else if (pointerOperator instanceof ICPPASTReferenceOperator) { - buffer.append(Keywords.cpAMPER); + if (((ICPPASTReferenceOperator) pointerOperator).isRValueReference()) { + buffer.append(Keywords.cpAND); + } else { + buffer.append(Keywords.cpAMPER); + } } } return buffer;