Skip to content

Commit

Permalink
Add test for trailing return types at prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
devajithvs authored and jenkins committed Dec 6, 2024
1 parent 1e1a2f3 commit 2cc444d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/Prompt/DontWrap.C
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,32 @@ long double ldFun(long double x) {
ldFun(2.0)
// CHECK: (long double) 4.0


auto simpleTrailingReturn() -> int {
return 22;
}
simpleTrailingReturn()
// CHECK: (int) 22

#include <vector>
auto vectorReturn() -> std::vector<int> {
return {1, 2, 3};
}
vectorReturn()
// CHECK: (std::vector<int>) { 1, 2, 3 }

int globalValue = 50;
auto referenceReturn() -> int& {
return globalValue;
}
referenceReturn()
// CHECK: (int) 50

auto pointerReturn() -> int* {
return &globalValue;
}
*pointerReturn()
// CHECK: (int) 50

class Test {
public:
Test(int a, int b);
Expand Down

0 comments on commit 2cc444d

Please sign in to comment.