Skip to content

[Transform][BUG] remove static when forward sourceTypeStrs #162

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 4 commits into from
Jul 11, 2024

Conversation

crazydemo
Copy link

No description provided.

@Menooker
Copy link

Menooker commented Jul 11, 2024

Sorry, it is not what I expected. some_array_ref = std::array<...>{...} is always wrong...

std::array<...>{...} is a temp value. It is different from below, which is correct:

std::array<...> a{...};
some_array_ref = a;

Please note that a is a named variable, which is killed at the end of the scope, while some_array_ref = std::array<...>{...} kills the array after the end of the statement.

While dealing with arrayref, please always pay attention whether the thing you pass into the ref has a longer lifetime than the ref itself.

@Menooker
Copy link

Also I suggest using std::array<...>{x,y,z} over std::array<...>({x,y,z}). The () are redundant, and will trigger ambiguous-error in some old compilers.

@crazydemo crazydemo force-pushed the zhangyan/fix_gc_check branch 2 times, most recently from 3ba4442 to e8f7c3c Compare July 11, 2024 03:51
@crazydemo crazydemo merged commit 1b1ebf2 into main Jul 11, 2024
4 checks passed
@crazydemo crazydemo deleted the zhangyan/fix_gc_check branch September 2, 2024 05:31
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.

3 participants