Skip to content

[clang-repl] Typo within InterpreterTest.cpp #79119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nasherm
Copy link
Contributor

@nasherm nasherm commented Jan 23, 2024

Recent changes to InterpreterTest.cpp (#76218) introduced typos within code passed to a Parse() function. This causes some tests to fail, namely IncrementalProcessing.InstantiateTemplate.

Recent changes to InterpreterTest.cpp introduced typos
within code passed to a Parse() function. This causes some
tests to fail, namely IncrementalProcessing.InstantiateTemplate.

Change-Id: I79a09030f980b1bc766e27cc6acb944fbc2422ac
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 23, 2024
@nasherm nasherm requested a review from vgvassilev January 23, 2024 10:51
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2024

@llvm/pr-subscribers-clang

Author: Nashe Mncube (nasherm)

Changes

Recent changes to InterpreterTest.cpp (#76218) introduced typos within code passed to a Parse() function. This causes some tests to fail, namely IncrementalProcessing.InstantiateTemplate.


Full diff: https://github.com/llvm/llvm-project/pull/79119.diff

1 Files Affected:

  • (modified) clang/unittests/Interpreter/InterpreterTest.cpp (+2-1)
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index e76c0677db5ead1..6d2e5c79bc242ce 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -256,7 +256,8 @@ static Value AllocateObject(TypeDecl *TD, Interpreter &Interp) {
   // cantFail(Interp.ParseAndExecute("new " + Name + "()", &Addr));
 
   // The lifetime of the temporary is extended by the clang::Value.
-  cantFail(Interp.ParseAndExecute(Name + "()", &Addr));
+  cantFail(Interp.ParseAndExecute(Name + "();", &Addr));
+  Addr.setKind(Value::Kind::K_PtrOrObj);
   return Addr;
 }
 

@@ -256,7 +256,8 @@ static Value AllocateObject(TypeDecl *TD, Interpreter &Interp) {
// cantFail(Interp.ParseAndExecute("new " + Name + "()", &Addr));

// The lifetime of the temporary is extended by the clang::Value.
cantFail(Interp.ParseAndExecute(Name + "()", &Addr));
cantFail(Interp.ParseAndExecute(Name + "();", &Addr));
Addr.setKind(Value::Kind::K_PtrOrObj);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we need this? The missing semicolon on the previous line is on purpose. This tells the interpreter to store its result into the Value object.

@nasherm
Copy link
Contributor Author

nasherm commented Jan 26, 2024

Need to follow proper contribution process. So closing for now

@nasherm nasherm closed this Jan 26, 2024
@nasherm nasherm deleted the nasherm/interpreter-test-typo branch January 26, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants