Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
22 votes
1 answer
1k views

GCC 15.2 (and many older versions) accepts the following code, while Clang 21.1 (and many older versions) don't: struct Wrapper { explicit Wrapper(int) {} }; template <int N = 0> struct ...
5 votes
1 answer
132 views

[stdatomics.h.syn] specifies the following: template<class T> using std-atomic = std::atomic<T>; // exposition only #define _Atomic(T) std-atomic<T> libc++ and libstdc++ ...
4 votes
1 answer
258 views

I'm having a C1001 issue (internal compiler error) when a class is declared and not when it is commented. Compiling the following code with cl /std:c++latest /O2 /Oi /fp:fast /Gy /GL /Gw /EHsc /MD /...
7 votes
1 answer
335 views

When compiling the following code using GCC 9.3.0 with O2 optimization enabled and running it on Ubuntu 20.04 LTS, x86_64 architecture, unexpected output occurs. #include <algorithm> #include &...
1 vote
1 answer
211 views

Normally, I can place function calls after std::unreachable, and it has no effect. This works on MSVC, Clang, and GCC, except with GCC there is an extra detail that makes it fail compilation: #include ...
2 votes
0 answers
105 views

I have long thought it odd that MSVC uses __int64 as the name for type long long in all of its diagnostic messages. // MSVC outputs "__int64" std::cout << typeid(long long).name(); It ...
2 votes
1 answer
96 views

I am trying to build some C++ code in the GitHub CI. This works for GCC and Clang, but compilation with MSVC fails in very weird ways. The very first error is found at: template <bool constant, ...
0 votes
1 answer
67 views

Consider this class: public class Number { [System.Obsolete()] public string ToExactString() => ""; [System.Obsolete()] public override string ToString() => "&...
1 vote
0 answers
95 views

This is a follow-up related to Inconsistent false positives with Clang CFI sanitizer and function pointers, but it is for a separate issue Issue Background I have an array of structs which store ...
0 votes
0 answers
64 views

I've encountered a bug when using Clang[1] with libomp[2] whereby using omp_priv = omp_orig in the initializer of a custom OpenMP reduction silently gives erroneous output. For example: /* file.cpp */ ...
6 votes
1 answer
107 views

Look at this code (godbolt): template <typename ...T> void func(const char *it, T &&...t) {} template <typename A, typename B> void func(A &&a, B &&b) {} int main(...
1 vote
0 answers
122 views

Issue Background I have an array of structs which store function pointers, which I loop over and call (my real code is more complex than the sample given). To ensure correct behaviour, I enabled CFI ...
2 votes
1 answer
314 views

Background I have a struct with a flexible array member, which I am using to store arbitrarily-sized data inline (for a generic linked list for any element type), and I can simply cast data to T* to ...
0 votes
0 answers
65 views

The following code generates an error on clang 19.1.0, but passes on older versions, gcc and msvc (live example). template <typename> void func() { (void)[]<typename>() consteval { ...
Joel's user avatar
  • 1,777
4 votes
2 answers
205 views

I have a C++ program that creates a two-element array of structs, then outputs the a field from one of the structs based on user input. When user the inputs 1 to the program, it should print 0 since ...

15 30 50 per page
1
2 3 4 5
...
25

AltStyle によって変換されたページ (->オリジナル) /