Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
Both clang and MSVC compile the below fine - gcc fails.
https://godbolt.org/z/hfPdKT
#include
template
struct S {
template
S(Arg&&... arg);
}
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
https://godbolt.org/z/4cbr24
void f()
{
int a;
int b;
bool c;
if ((!((int(bool(a))) ^ (int(bool(b && !(c))) {}
}
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
In the code below gcc should call f() prios to calling b(), but that does not
happen.
https://godbolt.org/z/e245vi
void f();
void b(void* p = (f(), nullptr));
void z
onent: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
https://godbolt.org/g/Z1cqm9
#include
struct my_hash {
std::size_t operator() (int const&) /*const*/ {
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
https://godbolt.org/z/RnO6a-
#include
#include
#include
template
constexpr int int_from_bits()
{
constexpr auto a = std::array{bits
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
Code below compiles in GCC, but is discarded by clang.
namespace A {
extern "C" int g() { return
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
https://godbolt.org/z/zvJQ4F
For the following code GCC will fail to compile the {} and the nullptr
initializes.
#include
struct foo;
struct bar
{
#if defined
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85552
--- Comment #4 from Tiago Macarios ---
Related clang bug: https://bugs.llvm.org/show_bug.cgi?id=39363
: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
As per http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3478.html
the below should not compile.
https://godbolt.org/z/mOpxau
bool foo(int* bar)
{
return bar > 0;
}
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
With the code below clang generates:
main: # @main
mov eax, 2
ret
GCC will get to the correct result, but will keep the new calls:
main:
sub rsp, 8
mov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88118
--- Comment #6 from Tiago Macarios ---
Related clang bug: https://bugs.llvm.org/show_bug.cgi?id=39731
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
Looking at http://eel.is/c++draft/temp.arg.nontype I would think that the code
below is C++17 complaint.
GCC thinks this is only
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
https://godbolt.org/z/13j51h
struct [[nodiscard]] S{};
void f();
void _()
{
f(), S{};
}
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
clang diagnoses unnecessary functions, gcc fails to:
https://godbolt.org/z/vvErGh
static void f()
{
[[maybe_unused]] auto var = &f;
}
: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
for the following code gcc will not detect that f() is never called. msvc
detects this correctly.
https://godbolt.org/z/Y5n78v
```
void f();
void _(int num) {
switch (num
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98750
--- Comment #2 from Tiago Macarios ---
Correct. I was expecting a warning there.
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
In C++20 gcc will chose the incorrect overload for this code. The overload
should be ambiguous (see msvc).
https://godbolt.org/z/rox1z1Txa
```
namespace N {
struct C
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282
Tiago Macarios changed:
What|Removed |Added
CC||tiagomacarios at gmail dot com
at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
The following code compiles fine with clang and msvc, but fails with gcc.
https://godbolt.org/z/e4dP7rzar
```
#include
template
using array_view = std::span;
void fun(std::span s) {
[[maybe_unused
++
Assignee: unassigned at gcc dot gnu.org
Reporter: tiagomacarios at gmail dot com
Target Milestone: ---
The following code compiles fine with clang and MSVC. gcc errors
https://godbolt.org/z/1MPvrjfaK
```
#include
template
struct S {
friend consteval S operator""_S(
20 matches
Mail list logo