Search
86 results for “glloyd”
-
@glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26
-
@glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26
-
@glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26
-
@glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26
-
@glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26
-
RE: https://fosstodon.org/@glloyd/115966242032349737
And now I fixed it, just needs to be merged.
https://github.com/llvm/llvm-project/pull/178471 -
@glloyd Reasons to skip #meetups and #TechEvents: honestly, I am shy and feel like I am not good enough for the community. I feel like they have higher knowledge and I would just annoy them. I feel like the community would reject me as a noob. I talk about the community around me.
-
@bjn that is a great bug.
simplified https://godbolt.org/z/MnEGcE595 -
@bjn that is a great bug.
simplified https://godbolt.org/z/MnEGcE595 -
@bjn that is a great bug.
simplified https://godbolt.org/z/MnEGcE595 -
@bjn that is a great bug.
simplified https://godbolt.org/z/MnEGcE595 -
@bjn that is a great bug.
simplified https://godbolt.org/z/MnEGcE595 -
Another post, a bit of a write up of various C++20 module issues I've hit over several months.
https://ignition.github.io/posts/cpp20-modules-the-tooling-gap/
-
I finally wrote up something I've presented at meetups for a while.
When you refactor, you're doing similar transformations compilers do: propagation, sinking, inlining, fusion. But the refactoring literature has gaps, some useful moves don't have names. In this post I called one "Distribute for Fusion", deliberately duplicating code into branches so you can fuse and simplify.
https://ignition.github.io/posts/refactoring-as-algebra/
Does this have an established name?
-
I finally wrote up something I've presented at meetups for a while.
When you refactor, you're doing similar transformations compilers do: propagation, sinking, inlining, fusion. But the refactoring literature has gaps, some useful moves don't have names. In this post I called one "Distribute for Fusion", deliberately duplicating code into branches so you can fuse and simplify.
https://ignition.github.io/posts/refactoring-as-algebra/
Does this have an established name?
-
#clangd is has issues when module import is in a header file, and not the cpp file. This is not a problem for clang, its all in the same translation unit. AFAICT this is legal and fine C++20 module code, clangd shouldn't have this issue.
-
Found bug in clang-tidy with C++20 modules. A single check can conflict with itself.
-
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
-
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
-
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
-
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
-
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
-
#if DECLARE_CONSTEXPR
template<typename T>
constexpr int f1(); // works
#else
template<typename T>
inline int f1(); // also works
#endiftemplate<>
constexpr int f1<int>(){ return 1;}static int global = 2;
template<>
inline int f1<double>(){ return global;}constexpr int f2(); // here declaration must match definition
constexpr int f2() { return 3; }int main() {
constexpr auto v1 = f1<int>();
auto const v2 = f1<double>();
auto const v3 = f2();
return v1 + v2 + v3;
} -
TIL: C++23 you can use named universal character escapes
#include <print>
int main() {
std::print("\N{GREEN HEART}"); // 💚
}https://en.cppreference.com/w/cpp/language/escape.html#Named_universal_character_escapes
-
Any diagnostic to find cyclic dependencies?
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
add_library(A STATIC)
target_sources(A PUBLIC
FILE_SET CXX_MODULES FILES mod.cppm # export module x;
)
target_link_libraries(A PRIVATE B)
add_library(B STATIC use.cpp) # import x;
target_link_libraries(B PRIVATE A)All you get ATM is failure at compile time `fatal error: module 'x' not found`
But it would be nice to know that the real issue is that A and B make a cycle
-
What is the reasonable way to test internal parts of a module?
For a complex module I want unit tests for parts that I do not want to export. Do I make an internals module that can be tested. Then have the actual module which only re-export what I intend to be the library's interface?
-
Working with #cpp20 #cppmodules with #ninjabuild and #cmake
How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?
ATM I have this hack
```
# cmake config
cmake --preset thing# select what I need made
ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build# then I can run clang-tidy
```There must be a better way
-
Working with #cpp20 #cppmodules with #ninjabuild and #cmake
How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?
ATM I have this hack
```
# cmake config
cmake --preset thing# select what I need made
ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build# then I can run clang-tidy
```There must be a better way
-
Working with #cpp20 #cppmodules with #ninjabuild and #cmake
How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?
ATM I have this hack
```
# cmake config
cmake --preset thing# select what I need made
ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build# then I can run clang-tidy
```There must be a better way
-
Working with #cpp20 #cppmodules with #ninjabuild and #cmake
How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?
ATM I have this hack
```
# cmake config
cmake --preset thing# select what I need made
ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build# then I can run clang-tidy
```There must be a better way