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

Compile error in generator.transpose.cpp: taking address of rvalue #237

Open
electroniceel opened this issue Jun 6, 2021 · 1 comment
Open

Comments

@electroniceel
Copy link

Since gcc 11 the compiler detects this problem and aborts the compilation:

src/library/generator.transpose.cpp: In function 'clfftStatus clfft_transpose_generator::genSwapKernelGeneral(const Signature&, std::string&, std::string&, const size_t&, size_t)':
src/library/generator.transpose.cpp:1092:95: error: taking address of rvalue [-fpermissive]
1092 | std::string smaller_dim_str = static_caststd::ostringstream*(&(std::ostringstream() << smaller_dim))->str();
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
src/library/generator.transpose.cpp:1093:93: error: taking address of rvalue [-fpermissive]
1093 | std::string dim_ratio_str = static_caststd::ostringstream*(&(std::ostringstream() << dim_ratio))->str();
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

It seems to me that the compiler is right in this case and the code indeed tries to get an address of a temporary object, which is not allowed in C++.

electroniceel added a commit to electroniceel/scopehal-rpms that referenced this issue Jun 6, 2021
@C-Erastus
Copy link

Hi, I'm running into the same problem as described above. I was wondering how does the recommended fix work??

iMichka added a commit to iMichka/homebrew-core that referenced this issue Mar 10, 2023
Does not build on Ventura
Does not build with newest gcc

See
clMathLibraries/clFFT#237

1 download last month
No new release since 2017
BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this issue Mar 10, 2023
Does not build on Ventura
Does not build with newest gcc

See
clMathLibraries/clFFT#237

1 download last month
No new release since 2017

Closes #125341.

Signed-off-by: Patrick Linnane <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
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

No branches or pull requests

2 participants