Skip to content

Commit 556a757

Browse files
committed
Make test.cpp compile
1 parent 0c41e37 commit 556a757

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cpp/autosar/test/rules/A0-1-1/test.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ static void foo(B &b) noexcept {
3131
b4.g();
3232
auto &b5 = *new B();
3333
b5.g();
34-
auto &b5 = new B();
35-
b5.g();
34+
/* Below causes a compile error (non-const reference when initialized should
35+
* hold an lvalue)
36+
*/
37+
// auto &b6 = new B();
38+
// b6.g();
3639
}
3740

3841
template <typename T> void test() {

0 commit comments

Comments
 (0)