Gcc and clang reject move constructor with =default
I wrote the following program that compiles with EDG but is rejected by gcc, clang and msvc. Demo
What is the “original spelling” of a preprocessing token?
C++23/cpp.stringize states:
Explicit object member function discrepancies between different compilers
The bounty expires in 6 days. Answers to this question are eligible for a +400 reputation bounty. Alan wants to reward an existing answer. I wrote the following program in c++23. Here I’ve overloaded member functions. But for all cases different compilers give different result as shown below in comment. As you can see I […]
Explicit this member function use accepted by msvc but rejected by clang and gcc
I wrote the following program that compiles with msvc but rejected by clang and gcc. It uses explicit object member function. Demo.
Explicit this object parameter wonkiness
So, I was toying around with some little code snippet that I’d seen passing by on Reddit, and it made me wonder if the code is actually legal and in accordance with the C++23 standard. Because, as it seems, all of the major compilers (Clang, GCC, and MSVC), have something different to say about it.
Semantics of functions taking a QChar * when passed a void * or const void *
This is a follow-up to: What is the new QChar* in C23?, where @Lundin showed me a sample implementation of a function that take
a QChar *
with _Generic
, after which I implemented strchrnul()
like so:
Can the expanded code of an inline function differ between 2 translation units?
Say I have a macro UNIQUE_NAME(PREFIX)
that concatenates __LINE__
to PREFIX
. If this macro was to be used in an inline
function, included in two different translation units, then the expanded code of the inline
function would differ between the two translation units (unless they have the same includes).
list vs direct aggregate initialization of implicitly initialized fields
If we contrast list initialization of an aggregate and direct initialization of an aggregate, if I don’t specify initializers for all fields, then I suppose the following applies: