Skip to content
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

Fix prvalue to xvalue conversion address space assignment #464

Merged

Conversation

Naghasan
Copy link
Member

@Naghasan Naghasan commented Sep 21, 2023

The common address deduction rules assumed prvalue-to-xvalue conversion can only happens inside a function.
The patch aligns the rules to match declaration rules.

It is a bit of a corner case, but the spec treated all 3 conversions bellow in the same way.

constexpr const int& foo = 5;

class Foo {
public:
  static constexpr const int& foo = 42;
};

void bar() {
    const int& foo = 42;
}

@CLAassistant
Copy link

CLAassistant commented Sep 21, 2023

CLA assistant check
All committers have signed the CLA.

@keryell
Copy link
Member

keryell commented Nov 9, 2023

@Naghasan ping!

@Naghasan
Copy link
Member Author

Naghasan commented Nov 9, 2023

@keryell I extended the initial text to also account for the context in which prvalue to xvalue is taking place. I find it a bit "hand wavy" but still acceptable.

The new commit also account for this:

void bar() {
    static constexpr const int& foo = 42;
}

The common address deduction rules assumed prvalue-to-xvalue conversion
can only happens inside a function.
The patch aligns the rules to match declaration rules.
Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

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

Thanks!

@Naghasan
Copy link
Member Author

Resolved conflict: rebased to head and ran reflow

Naghasan and others added 2 commits December 7, 2023 14:48
Co-authored-by: Greg Lueck <gregory.m.lueck@intel.com>
Signed-off-by: Victor Lomuller <victor@codeplay.com>
@gmlueck gmlueck merged commit 1b270b2 into KhronosGroup:SYCL-2020/master Dec 7, 2023
2 checks passed
keryell pushed a commit that referenced this pull request Sep 10, 2024
Fix prvalue to xvalue conversion address space assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants