mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
Bug 427856 - [Outline] Incorrect parameters of functions with rvalue reference
Change-Id: I4761e65a21d8e958cb5cb1a74ebcf18dfd5a1603 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/32513 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Hudson CI
This commit is contained in:
parent
ca60372079
commit
554c753e31
2 changed files with 13 additions and 1 deletions
|
@ -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&&)");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue