Potential GCC 16 bug: annotations disappear on nested class declarations inside class templates
Im playing around with reflection (GCC16) and I ran into the following problem:
When using `std::meta::define_aggregate`to complete an annotated nested class, the annotation is removed, iff the enclosing class is templated.
Below is a minimal reproducible example ([Godbolt link](https://godbolt.org/z/dGTsea7ad)).
I would expect both assertions to succeed, but they don't. There is also [GCC PR124399](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124399), which addresses a related problem, but I'm not sure if this is the *same* underlying problem.
Is this a bug, or am I overlooking/misunderstanding some template instantiation rules?
#include <meta>
// Works: ordinary forward declaration.
struct [[=42]] Ordinary;
static_assert(std::meta::annotations_of(^^Ordinary).size() == 1);
// Fails: forward declaration inside a class template.
template <typename T>
struct Outer {
struct [[=42]] Inner;
};
static_assert(sizeof(Outer<int>) > 0);
static_assert(std::meta::annotations_of(^^Outer<int>::Inner).size() == 1);
**Context:** I'm experimenting with rust-like `derive(debug)` functionality using annotations, combined with structural type transformations (similar to AoS to SoA). I originally encountered this while trying to propagate annotations to a generated type, before reducing it to the example above.
https://redd.it/1xovcbd
@r_cpp
Im playing around with reflection (GCC16) and I ran into the following problem:
When using `std::meta::define_aggregate`to complete an annotated nested class, the annotation is removed, iff the enclosing class is templated.
Below is a minimal reproducible example ([Godbolt link](https://godbolt.org/z/dGTsea7ad)).
I would expect both assertions to succeed, but they don't. There is also [GCC PR124399](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124399), which addresses a related problem, but I'm not sure if this is the *same* underlying problem.
Is this a bug, or am I overlooking/misunderstanding some template instantiation rules?
#include <meta>
// Works: ordinary forward declaration.
struct [[=42]] Ordinary;
static_assert(std::meta::annotations_of(^^Ordinary).size() == 1);
// Fails: forward declaration inside a class template.
template <typename T>
struct Outer {
struct [[=42]] Inner;
};
static_assert(sizeof(Outer<int>) > 0);
static_assert(std::meta::annotations_of(^^Outer<int>::Inner).size() == 1);
**Context:** I'm experimenting with rust-like `derive(debug)` functionality using annotations, combined with structural type transformations (similar to AoS to SoA). I originally encountered this while trying to propagate annotations to a generated type, before reducing it to the example above.
https://redd.it/1xovcbd
@r_cpp
godbolt.org
Compiler Explorer - C++ (x86-64 gcc 16.2)
// Works: ordinary forward declaration.
struct[[= 42]] Ordinary;
static_assert(std::meta::annotations_of(^^Ordinary).size() == 1);
// Fails: forward declaration inside a class template.
template <typename T>
struct Outer {
struct[[= 42]] Inner;
};
…
struct[[= 42]] Ordinary;
static_assert(std::meta::annotations_of(^^Ordinary).size() == 1);
// Fails: forward declaration inside a class template.
template <typename T>
struct Outer {
struct[[= 42]] Inner;
};
…
"C++26 DIS failed, how does C++ survive?"
https://andreasfertig.com/blog/2026/11/cpp26-dis-failed-how-does-cpp-survive/
https://redd.it/1xpcz59
@r_cpp
https://andreasfertig.com/blog/2026/11/cpp26-dis-failed-how-does-cpp-survive/
https://redd.it/1xpcz59
@r_cpp
Andreasfertig
C++26 DIS failed, how does C++ survive?
On October 23, 2026, the unthinkable happened. It was supposed to be a mere formality: C++26 was up for a vote by the ISO National Bodi...
Dealing with AI Slop At Work
I work at a C++ shop with coders that I really respected - very deep C++ knowledge and are building very technical deep systems products. Over the last few months the CTO has gone off the deep end with AI talking of creating software factory (He’s been reading too much X), he releases huge multi thousand line PRs with basically no review. All sense of scientific temperament and engineering rigour has gone out of the window it seems.
I do believe that AI is a transformational tool and I use it plenty in the development process but I still strive to understand what the AI has written and often use the AI as multiplier rather than surrendering my thinking to it. it’s become increasingly hard to actually develop while deeply understanding the codebase because it has become so sloppy.
I am very sad as this means I’m not really interfacing with writing C++ as much and exploring cool new corners of the language in my daily work.
There is definitely some cool stuff this lets us do a bit more of - high level planning and systems design by reading many papers as well as exploring formal verification.
But overall I am left disappointed. I wonder how it is like at everyone else’s work places and if anyone has any thoughts and suggestions on how I can still develop my C++ knowledge.
https://redd.it/1xpshkh
@r_cpp
I work at a C++ shop with coders that I really respected - very deep C++ knowledge and are building very technical deep systems products. Over the last few months the CTO has gone off the deep end with AI talking of creating software factory (He’s been reading too much X), he releases huge multi thousand line PRs with basically no review. All sense of scientific temperament and engineering rigour has gone out of the window it seems.
I do believe that AI is a transformational tool and I use it plenty in the development process but I still strive to understand what the AI has written and often use the AI as multiplier rather than surrendering my thinking to it. it’s become increasingly hard to actually develop while deeply understanding the codebase because it has become so sloppy.
I am very sad as this means I’m not really interfacing with writing C++ as much and exploring cool new corners of the language in my daily work.
There is definitely some cool stuff this lets us do a bit more of - high level planning and systems design by reading many papers as well as exploring formal verification.
But overall I am left disappointed. I wonder how it is like at everyone else’s work places and if anyone has any thoughts and suggestions on how I can still develop my C++ knowledge.
https://redd.it/1xpshkh
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Cpp header issue
I am working with cpp in Clang but when trying to compile the file it shows error that <cmath> header isn't found what to do with it?
\#r/cpp_questions
https://redd.it/1xpyt9o
@r_cpp
I am working with cpp in Clang but when trying to compile the file it shows error that <cmath> header isn't found what to do with it?
\#r/cpp_questions
https://redd.it/1xpyt9o
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Learning without AI
How did ya’ll learn programming pre-AI? How would you go about learning if you had to start all over again without AI?
I find myself relying on AI too much and want to actually learn without leaning on it at all. Any help with how best to approach this would be great.
https://redd.it/1xpz6ig
@r_cpp
How did ya’ll learn programming pre-AI? How would you go about learning if you had to start all over again without AI?
I find myself relying on AI too much and want to actually learn without leaning on it at all. Any help with how best to approach this would be great.
https://redd.it/1xpz6ig
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
hpx.dev – The documentation and community portal for the HPX project
Sharing **https://hpx.dev**, the central web portal for the open-source HPX C++ runtime.
The site serves as a dedicated hub for HPX developer resources, engineering updates, and community content. Currently, you can find:
Official Documentation: Direct, searchable access to the HPX API references and technical manuals.
Engineering Blog & Release Notes: Technical write-ups on architectural updates, subsystem integration, and project releases.
Contributor Reports: Detailed summaries from open-source contributors, including deep-dives into recent Google Summer of Code (GSoC) projects.
The "HPX In Action" Series: Ongoing interviews featuring developers, researchers, and contributors discussing their workflows and HPC challenges.
Feedback from the C++ community on the site's content and organization is always welcome.
https://redd.it/1xq2yke
@r_cpp
Sharing **https://hpx.dev**, the central web portal for the open-source HPX C++ runtime.
The site serves as a dedicated hub for HPX developer resources, engineering updates, and community content. Currently, you can find:
Official Documentation: Direct, searchable access to the HPX API references and technical manuals.
Engineering Blog & Release Notes: Technical write-ups on architectural updates, subsystem integration, and project releases.
Contributor Reports: Detailed summaries from open-source contributors, including deep-dives into recent Google Summer of Code (GSoC) projects.
The "HPX In Action" Series: Ongoing interviews featuring developers, researchers, and contributors discussing their workflows and HPC challenges.
Feedback from the C++ community on the site's content and organization is always welcome.
https://redd.it/1xq2yke
@r_cpp
Is there any point in improving the/any language at this point ?
What's the point of spending years debating new syntax, language features, and abstractions if the majority of future C++ code might not be written by humans anyway?
https://redd.it/1xq5qq4
@r_cpp
What's the point of spending years debating new syntax, language features, and abstractions if the majority of future C++ code might not be written by humans anyway?
https://redd.it/1xq5qq4
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
New C++ Conference Videos Released This Month - November 2026 (Updated To Include Videos Released 2026-11-02 - 2026-11-08)
C++Now
2026-11-02 - 2026-11-08
Lightning Talk: The Hidden Superpower of Modern CPUs - Why ILP Can Make “More Work” Run Faster - Sampad Acharya - [https://youtu.be/WZl7tMBBn3U](https://youtu.be/WZl7tMBBn3U)
Lightning Talk: When Weird Things Happen - Ruslan Arutyunyan - https://youtu.be/VEIJkIEKEQ4
Lightning Talk: A Metaprogramming Checklist - Ben Deane - [https://youtu.be/6n\_mOFP\_kBA](https://youtu.be/6n_mOFP_kBA)
2026-10-26 - 2026-11-01
AI is Forcing us to Obey Scott Meyers - Jody Hagins - https://youtu.be/CiaZq4kCH08
C++ Libraries - The Road Ahead - Jeffrey Garland - [https://youtu.be/bNipVnNaDdk](https://youtu.be/bNipVnNaDdk)
Lightning Talk: ?: - Jonathan Müller - https://youtu.be/TLj6NVx5xvk
ACCU
2026-11-02 - 2026-11-08
Implementing C++ Standard Library - Design and Optimisations in Libc++ - Hui Xie - [https://youtu.be/9efvPYY7CuY](https://youtu.be/9efvPYY7CuY)
How Invariant are Invariants? - David Olsen - https://youtu.be/TLk4mm4u02A
The Biggest Misconception of Computer Science - Alex Dathskovsky - [https://youtu.be/EwgkN3an1Gs](https://youtu.be/EwgkN3an1Gs)
2026-10-26 - 2026-11-01
Creating Composable Callables in Contemporary C++ - Using Senders / Receivers as a Frame Graph - Björn Fahller - https://youtu.be/A4mMO5xeQDA
Incrementally Migrating C++ to a Memory Safe Language with Swift - Tim Condon - [https://youtu.be/LMQ21X6\_2FQ](https://youtu.be/LMQ21X6_2FQ)
CallMeMaybe - Building Modern Runtime Reflection via C++26 - Laurie Kirk - https://youtu.be/cA0F3wRtZIU
ADC
2026-11-02 - 2026-11-08
Are You Shipping Your Source Code? - Ryan Wardell - [https://youtu.be/ToPPQ6uTUJ0](https://youtu.be/ToPPQ6uTUJ0)
Porting a Native C++ Synth Engine to the Browser: Lessons from Katokatone - Kazuhito Inoue - https://youtu.be/KmX7mfkvDHg
Generative Instruments with Large Piano Models - Tomek Roszczynialski - [https://youtu.be/EO-hGj8\_BUY](https://youtu.be/EO-hGj8_BUY)
2026-10-26 - 2026-11-01
TX/RX Part 2 - AI Audio on the Raspberry Pi - Kieran Coulter - https://youtu.be/QSiyLDHoBpo
JUCE in DJ Products - Current Status and Future Prospects - Masamichi Tomii, Akihito Yamada & Tetsuro Abe - [https://youtu.be/VElORkcpE78](https://youtu.be/VElORkcpE78)
Generative Instruments with Large Piano Models - Tomek Roszczynialski - https://youtu.be/EO-hGj8\_BUY
C++Day
2026-10-26 - 2026-11-01
\[C++ Day 2026\] Old-School C++ for the Agentic Age: Lessons from Sane C++ (Stefano Cristiano) - [https://www.youtube.com/watch?v=tAf-HsET0pE](https://www.youtube.com/watch?v=tAf-HsET0pE)
[C++ Day 2026\] Zero-cost GIS: parsing binary formats in C++23 (Giorgio Bignotti) - https://www.youtube.com/watch?v=VHeNHf6t76Q
https://redd.it/1xqz179
@r_cpp
C++Now
2026-11-02 - 2026-11-08
Lightning Talk: The Hidden Superpower of Modern CPUs - Why ILP Can Make “More Work” Run Faster - Sampad Acharya - [https://youtu.be/WZl7tMBBn3U](https://youtu.be/WZl7tMBBn3U)
Lightning Talk: When Weird Things Happen - Ruslan Arutyunyan - https://youtu.be/VEIJkIEKEQ4
Lightning Talk: A Metaprogramming Checklist - Ben Deane - [https://youtu.be/6n\_mOFP\_kBA](https://youtu.be/6n_mOFP_kBA)
2026-10-26 - 2026-11-01
AI is Forcing us to Obey Scott Meyers - Jody Hagins - https://youtu.be/CiaZq4kCH08
C++ Libraries - The Road Ahead - Jeffrey Garland - [https://youtu.be/bNipVnNaDdk](https://youtu.be/bNipVnNaDdk)
Lightning Talk: ?: - Jonathan Müller - https://youtu.be/TLj6NVx5xvk
ACCU
2026-11-02 - 2026-11-08
Implementing C++ Standard Library - Design and Optimisations in Libc++ - Hui Xie - [https://youtu.be/9efvPYY7CuY](https://youtu.be/9efvPYY7CuY)
How Invariant are Invariants? - David Olsen - https://youtu.be/TLk4mm4u02A
The Biggest Misconception of Computer Science - Alex Dathskovsky - [https://youtu.be/EwgkN3an1Gs](https://youtu.be/EwgkN3an1Gs)
2026-10-26 - 2026-11-01
Creating Composable Callables in Contemporary C++ - Using Senders / Receivers as a Frame Graph - Björn Fahller - https://youtu.be/A4mMO5xeQDA
Incrementally Migrating C++ to a Memory Safe Language with Swift - Tim Condon - [https://youtu.be/LMQ21X6\_2FQ](https://youtu.be/LMQ21X6_2FQ)
CallMeMaybe - Building Modern Runtime Reflection via C++26 - Laurie Kirk - https://youtu.be/cA0F3wRtZIU
ADC
2026-11-02 - 2026-11-08
Are You Shipping Your Source Code? - Ryan Wardell - [https://youtu.be/ToPPQ6uTUJ0](https://youtu.be/ToPPQ6uTUJ0)
Porting a Native C++ Synth Engine to the Browser: Lessons from Katokatone - Kazuhito Inoue - https://youtu.be/KmX7mfkvDHg
Generative Instruments with Large Piano Models - Tomek Roszczynialski - [https://youtu.be/EO-hGj8\_BUY](https://youtu.be/EO-hGj8_BUY)
2026-10-26 - 2026-11-01
TX/RX Part 2 - AI Audio on the Raspberry Pi - Kieran Coulter - https://youtu.be/QSiyLDHoBpo
JUCE in DJ Products - Current Status and Future Prospects - Masamichi Tomii, Akihito Yamada & Tetsuro Abe - [https://youtu.be/VElORkcpE78](https://youtu.be/VElORkcpE78)
Generative Instruments with Large Piano Models - Tomek Roszczynialski - https://youtu.be/EO-hGj8\_BUY
C++Day
2026-10-26 - 2026-11-01
\[C++ Day 2026\] Old-School C++ for the Agentic Age: Lessons from Sane C++ (Stefano Cristiano) - [https://www.youtube.com/watch?v=tAf-HsET0pE](https://www.youtube.com/watch?v=tAf-HsET0pE)
[C++ Day 2026\] Zero-cost GIS: parsing binary formats in C++23 (Giorgio Bignotti) - https://www.youtube.com/watch?v=VHeNHf6t76Q
https://redd.it/1xqz179
@r_cpp
YouTube
The Hidden Superpower of Modern CPUs - Why ILP Can Make “More Work” Run Faster - Sampad Acharya
https://www.cppnow.org
---
Lightning Talk: The Hidden Superpower of Modern CPUs - Why ILP Can Make “More Work” Run Faster - Sampad Acharya - C++Now 2026
---
Instruction-Level Parallelism (ILP) is the most underused performance lever in modern C++. Every…
---
Lightning Talk: The Hidden Superpower of Modern CPUs - Why ILP Can Make “More Work” Run Faster - Sampad Acharya - C++Now 2026
---
Instruction-Level Parallelism (ILP) is the most underused performance lever in modern C++. Every…
How does one actually contribute to LLVM these days?
I have had several patches that I’ve sent PRs for )(using my work email since I thought that looked a bit more legitimate)
1. Someone who was nice responded to one of them and said that someone at Intel needed to code review i. Never got another response, I followed up in the comments and emailed the person at Intel no response
Patch 2) Someone responded that they were busy and would get around to it when they had a chance to. It’s been a few months and followed up in the comments to no response
patch 3) Someone was assigned to look at it. They worked at a company I haven’t heard about but they seem to no longer work there and the account has been deactivated since. I haven’t been able to get it reassigned.
I don’t really contribute to open source projects at all and I‘m unsure if this is the norm. All of them are fairly small patches to fix bugs I’ve experienced day to day and I’m curious if there’s a way to get file PRs that I am missing
https://redd.it/1xqdw64
@r_cpp
I have had several patches that I’ve sent PRs for )(using my work email since I thought that looked a bit more legitimate)
1. Someone who was nice responded to one of them and said that someone at Intel needed to code review i. Never got another response, I followed up in the comments and emailed the person at Intel no response
Patch 2) Someone responded that they were busy and would get around to it when they had a chance to. It’s been a few months and followed up in the comments to no response
patch 3) Someone was assigned to look at it. They worked at a company I haven’t heard about but they seem to no longer work there and the account has been deactivated since. I haven’t been able to get it reassigned.
I don’t really contribute to open source projects at all and I‘m unsure if this is the norm. All of them are fairly small patches to fix bugs I’ve experienced day to day and I’m curious if there’s a way to get file PRs that I am missing
https://redd.it/1xqdw64
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Stack vs heap for memory throughput
Hi,
I have a high datarate application (120 MB/s) which needs to work on an embedded system.
currently I use zmq to publsih the data on a socket. zmq takes a raw pointer to data, and needs to specify a deletion function when data is published. So I use malloc and free for that specific part. So this is all done on the heap.
would it be worth it to do this on the stack? The problem is, I cannot control how fast data is consumed, so I need a growing buffer of memory. In the end, data will be consumed realtime, but it may take some time before the system ”settles”. Preallocating a huge amount of memory on the stack is also not very desireable, due to memory constraints.
how do I approach performance optimization for memory management? I’ve already cut out all unneccesary copy operations.
https://redd.it/1xr3nfx
@r_cpp
Hi,
I have a high datarate application (120 MB/s) which needs to work on an embedded system.
currently I use zmq to publsih the data on a socket. zmq takes a raw pointer to data, and needs to specify a deletion function when data is published. So I use malloc and free for that specific part. So this is all done on the heap.
would it be worth it to do this on the stack? The problem is, I cannot control how fast data is consumed, so I need a growing buffer of memory. In the end, data will be consumed realtime, but it may take some time before the system ”settles”. Preallocating a huge amount of memory on the stack is also not very desireable, due to memory constraints.
how do I approach performance optimization for memory management? I’ve already cut out all unneccesary copy operations.
https://redd.it/1xr3nfx
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Herb Sutter: When a language’s creator and its owners strongly disagree: C++26 post-DIS, historical experience, and paths forward
https://isocpp.org/files/papers/P4454R0.pdf
https://redd.it/1xr8y5c
@r_cpp
https://isocpp.org/files/papers/P4454R0.pdf
https://redd.it/1xr8y5c
@r_cpp
Exploration of a more library-oriented approach to contracts (Voutilainen, 2026)
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4324r0.html
https://redd.it/1xrd81v
@r_cpp
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4324r0.html
https://redd.it/1xrd81v
@r_cpp
C++ White Paper Train, IS Snapshots
https://isocpp.org/files/papers/P2716R0.html
https://redd.it/1xrjw94
@r_cpp
https://isocpp.org/files/papers/P2716R0.html
https://redd.it/1xrjw94
@r_cpp
isocpp.org
C++ White Paper Train, IS Snapshots
Any time estimate for reflection in MSVC?
I haven’t seen an announcement for C++26 implementation in MSVC. Honestly, I am mostly interested in reflection. Anyone know of any estimate of when it ships in MSVC?
https://redd.it/1xrpy1d
@r_cpp
I haven’t seen an announcement for C++26 implementation in MSVC. Honestly, I am mostly interested in reflection. Anyone know of any estimate of when it ships in MSVC?
https://redd.it/1xrpy1d
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
A faster way to calculate the date of Easter
https://www.benjoffe.com/fast-easter
https://redd.it/1xsmn3e
@r_cpp
https://www.benjoffe.com/fast-easter
https://redd.it/1xsmn3e
@r_cpp
Ben Joffe
A faster Easter date function
A very fast 32-bit Easter calculation, accurate over ±10 million years.
InfoCell symbolic AI programming language embedded in C++ syntax
https://www.kaggle.com/competitions/arc-prize-2026-paper-track/writeups/solving-arc-agi-with-the-infocell-symbolic-ai-prog
https://redd.it/1xspdyk
@r_cpp
https://www.kaggle.com/competitions/arc-prize-2026-paper-track/writeups/solving-arc-agi-with-the-infocell-symbolic-ai-prog
https://redd.it/1xspdyk
@r_cpp
Kaggle
Solving ARC-AGI with the InfoCell symbolic AI programming language | Kaggle
Using mathematical equations as a regex like search expression on extended truth tables that can be "solved" to a regular OOP program
Stop Rebuilding the World: Faster C++ CI with vcpkg Binary Caching (Wed, Nov. 18th 6pm MDT)
https://www.meetup.com/utah-cpp-programmers/events/316452441/
https://redd.it/1xswtrd
@r_cpp
https://www.meetup.com/utah-cpp-programmers/events/316452441/
https://redd.it/1xswtrd
@r_cpp
Meetup
Stop Rebuilding the World: Faster C++ CI with vcpkg Binary Caching, Wed, Nov 18, 2026, 6:00 PM | Meetup
Your CI runners have better things to do than compile the same dependencies again. Learn how to put them on the fast track with [vcpkg-github-cache](https://github.com/Lega