Skip to content

Do not evaluate dependent immediate invocations #13700

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

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Sep 21, 2023

We deferred the evaluation of dependent immediate invocations in https://reviews.llvm.org/D119375 until instantiation. We should also not consider them referenced from a non-consteval context.

Fixes: llvm/llvm-project#55601

template<typename T>
class Bar {
  consteval static T x() { return 5; }
 public:
  Bar() : a(x()) {}

 private:
  int a;
};

Bar<int> g();

Is now accepted by clang. Previously it errored with: cannot take address of consteval function 'x' outside of an immediate invocation Bar() : a(x()) {}

Differential Revision: https://reviews.llvm.org/D132031


Fixes #13698, a problem with the new C++ headers from the new macOS SDK.

We deferred the evaluation of dependent immediate invocations in https://reviews.llvm.org/D119375 until instantiation.
We should also not consider them referenced from a non-consteval context.

Fixes: llvm/llvm-project#55601

```
template<typename T>
class Bar {
  consteval static T x() { return 5; }
 public:
  Bar() : a(x()) {}

 private:
  int a;
};

Bar<int> g();
```
Is now accepted by clang. Previously it errored with: `cannot take address of consteval function 'x' outside of an immediate invocation  Bar() : a(x()) {}`

Differential Revision: https://reviews.llvm.org/D132031

---

Fixes root-project#13698, a problem
with the new C++ headers from the new macOS SDK.
@hahnjo hahnjo requested a review from vgvassilev as a code owner September 21, 2023 12:10
@hahnjo hahnjo self-assigned this Sep 21, 2023
@hahnjo hahnjo changed the title [skip-ci] Do not evaluate dependent immediate invocations Do not evaluate dependent immediate invocations Sep 21, 2023
@hahnjo
Copy link
Member Author

hahnjo commented Sep 21, 2023

@phsft-bot build also on mac13/cxx20, mac13arm/cxx20

@phsft-bot
Copy link

Starting build on mac13/cxx20, mac13arm/cxx20, ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac11/noimt, mac12arm/cxx20, windows10/default
How to customize builds

@phsft-bot
Copy link

Build failed on mac13arm/cxx20.
Running on macphsft28.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-09-21T12:21:53.334Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:28:17.217Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:28:17.217Z] ld: warning: ignoring duplicate libraries: 'lib/libclingInterpreter.a', 'lib/libclingUtils.a'
  • [2023-09-21T12:28:17.546Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:28:20.709Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:28:21.326Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:28:21.326Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:28:21.326Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:28:21.641Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:28:26.464Z] ld: warning: -single_module is obsolete

And 891 more

Failing tests:

And 61 more

Copy link
Member

@dpiparo dpiparo left a comment

Choose a reason for hiding this comment

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

Thanks for this very nice PR prepared so quickly.

@dpiparo
Copy link
Member

dpiparo commented Sep 21, 2023

The numerous failures are fixed by this PR #13696

@phsft-bot
Copy link

Build failed on mac13/cxx20.
Running on macphsft21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-09-21T12:23:50.423Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:37:59.489Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:38:04.043Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:38:41.021Z] ld: warning: -single_module is obsolete
  • [2023-09-21T12:38:41.021Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:38:41.278Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:38:41.278Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:39:30.480Z] ld: warning: -bind_at_load is deprecated on macOS
  • [2023-09-21T12:39:30.480Z] ld: warning: ignoring duplicate libraries: 'lib/libclingInterpreter.a', 'lib/libclingUtils.a'
  • [2023-09-21T12:39:40.690Z] ld: warning: -single_module is obsolete

And 897 more

Failing tests:

And 61 more

@github-actions
Copy link

Test Results

         9 files           9 suites   2d 7h 1m 10s ⏱️
  2 488 tests   2 482 ✔️ 0 💤 6
21 442 runs  21 436 ✔️ 0 💤 6

For more details on these failures, see this check.

Results for commit 4f4032c.

@Axel-Naumann
Copy link
Member

Unbelievable @hahnjo - congratulations!

@dpiparo dpiparo merged commit 6627da7 into root-project:master Sep 21, 2023
@hahnjo hahnjo deleted the macos-llvm15-cxx20 branch September 21, 2023 15:38
@hahnjo
Copy link
Member Author

hahnjo commented Sep 21, 2023

FWIW there were build problems in the incremental GitHub Actions CI (because I forgot to set the right label); they are gone in a clean build triggered by the merge to master and we are left with the test failures. Let's see how the nightlies go and then I will backport tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants