[Bug c/29129] [4.2/4.3/4.4 Regression] [DR#341] unnamed parameters using [*]

2023-04-06 Thread zhonghao at pku dot org.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29129 zhonghao at pku dot org.cn changed: What|Removed |Added CC||zhonghao at pku dot org.cn

[Bug c/64480] List designated initializer triggers -Wmissing-field-initializers

2023-04-06 Thread zhonghao at pku dot org.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64480 zhonghao at pku dot org.cn changed: What|Removed |Added CC||zhonghao at pku dot org.cn

[Bug c/63495] struct __attribute__ ((aligned (8))) broken on x86

2023-04-06 Thread zhonghao at pku dot org.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63495 zhonghao at pku dot org.cn changed: What|Removed |Added CC||zhonghao at pku dot org.cn

[Bug c/85696] OpenMP with variably modified and default(none) won't compile

2023-04-05 Thread zhonghao at pku dot org.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85696 zhonghao at pku dot org.cn changed: What|Removed |Added CC||zhonghao at pku dot org.cn

[Bug c++/109426] New: Gcc runs into Infinite loop, when resolving templates

2023-04-05 Thread zhonghao at pku dot org.cn via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: typedef struct astruct_d { void *data; } astruct; /* Generate a whole bunch of unique fake mallocs, this keeps the vartrack dump simpler

[Bug c++/105997] New: A possible optimization bug

2022-06-16 Thread zhonghao at pku dot org.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- ZynAddSubFX is a musical synthesizer. I find a strange code in this project: https://github.com/zynaddsubfx/zynaddsubfx/blob/master/src/Misc/MiddleWare.cpp #if defined(__GNUC__) &&

[Bug middle-end/105905] A possible rounding error

2022-06-11 Thread zhonghao at pku dot org.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105905 --- Comment #2 from zhonghao at pku dot org.cn --- A programmer answered me, and provided some details. Here, I copy his response: "This code: Vector2 v{Math::sin(37.0_degf), Math::cos(37.0_degf)}; Utility::print("{:.10}\n",

[Bug c++/105905] New: A possible rounding error

2022-06-09 Thread zhonghao at pku dot org.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- magnum is a data visualization library. I notice that its programmers complained a rounding error in gcc. It occurs when compiling their code in the release version. To fix the problem

[Bug c++/105884] New: A possible optimization bug when uint64_t is used with -O2/-O3.

2022-06-08 Thread zhonghao at pku dot org.cn via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- zapret is a tool to bypass network blocking: https://github.com/bol-van/zapret/blob/master/docs/readme.eng.md I notice that its

[Bug c++/105882] New: A possible constexpr bug

2022-06-08 Thread zhonghao at pku dot org.cn via Gcc-bugs
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code sample is as follows: #include struct real128 { __float128 m_value; template constexpr bool get(T ) const { using value_type = typename T::value_type

[Bug c++/105881] New: GCC release mode can crash Torque3D

2022-06-08 Thread zhonghao at pku dot org.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- Torque3D is an open source game engine: https://torque3d.org/ When I read its code, I notice that it fixes a crash, and this crash can be caused by GCC. The bug report is https

[Bug c++/105460] New: sizeof (unsigned int) != sizeof (uint8_t *)

2022-05-03 Thread zhonghao at pku dot org.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- Clang's comments say there is an `unsigned int`-sized "reserved" member here, because when the objc4 modern runtime is used on LP64 platforms, there would otherwise b

[Bug c++/105457] New: error: '__builtin_huge_valq()' is not a constant expression

2022-05-02 Thread zhonghao at pku dot org.cn via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: template struct infinity{}; template <> struct infinity<__float128> { static constexpr __fl

[Bug c++/90925] gcc allows calling private overridden operators

2019-06-19 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90925 --- Comment #2 from zhonghao at pku dot org.cn --- A related code sample: class A { virtual int String (); }; class F: public A { }; template < typename V > class G { private: V value; }; class D { template < int N > void Veri

[Bug c++/90925] New: gcc allows calling private overridden operators

2019-06-19 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: class a { private: template a <<(b); }; a c(); template a fn2() { int d; return c() << d; } gcc accepts the code, but c

[Bug c++/90854] New: Gcc fails to compile a code sample for some parameters

2019-06-11 Thread zhonghao at pku dot org.cn
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: class A { int m_fn1 (void *); int m_fn2 (bool); }; inline int A::m_fn2 (bool) { static __attribute__ ((section ("&qu

[Bug c++/90853] New: -O3 complains already defined symbol

2019-06-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: void x(); void rgb2yuv16bit_mmx422_row(); void x() { rgb2yuv16bit_mmx422_row(); } void rgb2yuv16bit_mmx422_row() { __asm__ __volatile__

[Bug c++/90852] New: A recurring bug: Constant expressions support reinterpret_cast

2019-06-11 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A previous bug report (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49171) contains two samples: //--- constexpr const char* c

[Bug c++/90851] New: -O3 overflow

2019-06-11 Thread zhonghao at pku dot org.cn
at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: struct S { S (); S (int); ~S (); int i; }; struct A { S s[10]; }; void foo () { A a = {{}}; } It takes several minutes to compile the code. With the following

[Bug c++/90850] New: template parameters do not match

2019-06-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: template class C { template class C2 { }; }; template<> template class C::C2 { }; template<> template class C::C2 { }; gcc accepts the co

[Bug c++/90849] New: Gcc accepts invalid code

2019-06-11 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: template < typename = void > class A { public: A () : f0 ( 1 ) { } A (int); private: typedef A<> f0; }; A<> a; The code comes from a p

[Bug c++/90848] New: A recurring bug: Overeager application of conversion to function pointer during overload resolution of call to function object

2019-06-11 Thread zhonghao at pku dot org.cn
Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A bug report (https://gcc.gnu.org/bugzilla/show_bug.cgi

[Bug c++/90847] New: requested alignment is not an integer constant

2019-06-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: template void test() { constexpr int N2 = N; typedef int T alignas(N2); // error: requested alignment is not an integer constant } int

[Bug c++/90845] New: A recurring hang: braces around scalar initializer - should be a warning

2019-06-11 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A bug report complains that gcc shall warn braces around scalar initializer, and a test case is as follows: struct SA { int n[1

[Bug c++/90833] Inline specification is changed?

2019-06-11 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90833 --- Comment #1 from zhonghao at pku dot org.cn --- Here is the url of the previous bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88726 (In reply to zhonghao from comment #0) > A previous bug report has a code sample: > >

[Bug c++/90833] New: Inline specification is changed?

2019-06-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A previous bug report has a code sample: int main() { extern inline void f(); } void f() { } It says that gcc rejects the sample, but clang accepts it. The bug is marked

[Bug c++/90832] New: An ICE

2019-06-11 Thread zhonghao at pku dot org.cn
dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: class B { template friend struct A; B() {} }; template struct A { A() noexcept(sizeof(B{})) { } }; struct C { C() { static_assert( sizeof(A{}), "" ); } };

[Bug c++/90830] New: A not fully fixed ICE?

2019-06-11 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The bug report fixed a ICE: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70449 template constexpr int f () { enum E { a = f<0> () }; return 0; } Given the code, gcc 10.0.0 rejects th

[Bug c++/90829] New: -fopenacc expects iteration declaration or initialization

2019-06-11 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: void foo(float *f, double *r) { #pragma acc kernels loop create(f) copy(r) for(;;) {} } gcc accepts

[Bug c++/90828] New: A recurring hang when mangling

2019-06-10 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A bug report complains that there is endless recursion during mangling. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47202 It is marked as fixed. My gcc is 10.0.0. It takes me hours

[Bug c++/90807] New: Wrong debug message

2019-06-10 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: void f() { union { typeof ( ( { unsigned long __ptr; (int *)(0); } ) ) __val; }; } gcc rejects it with the following message: x86-64 gcc (trunk) 1

[Bug c++/90805] New: Overflow in switch case is not detected

2019-06-09 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: int f(int cmd) { switch (cmd) { case 0x8018U: return 1; } return 0; } gcc accepts the code, but clang can detect its overflow: :4:7

[Bug c++/90804] New: function declaration cannot have variably modified type

2019-06-09 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: int a(int b) {int (*c(void))[b];**c() = 2;} gcc accepts the code, but clang, icc, and msvc all reject

[Bug c++/90803] New: gcc accepts invalid code

2019-06-09 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: struct S {}; struct T : S {}; void foo(T *t) { t->~S(); } gcc accepts the code, but icc, msvc, and clang all reject it. msvc: (3): error C2300: 'T': class d

[Bug c++/90802] New: optimization accepts invalid

2019-06-09 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and the code is: typedef unsigned int uint32_t; struct CPUPPCState { uint32_t fpscr; }; register struct CPUPPCState *env __asm__ ("ebp"); void helpersetbit (ui

[Bug c++/90801] A recurring hang

2019-06-09 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90801 --- Comment #1 from zhonghao at pku dot org.cn --- Here is the url of the previous bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59659 (In reply to zhonghao from comment #0) > A previous bug report complains that gcc hangs w

[Bug c++/90801] New: A recurring hang

2019-06-09 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- A previous bug report complains that gcc hangs when compiling large zero-initialized std::array, and it is marked as fixed. My gcc is 10.0.0, but it still hangs given the following code sample: #include

[Bug c++/90798] New: An ICE with -Os

2019-06-09 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: #include #include void gather_swizzle(const __m128i *indices, float *buffer) { __m128i idx = *indices++; uint32_t idx0 = static_cast(_mm_extract_epi32(idx, 0

[Bug c++/90797] New: gcc reject valid code

2019-06-09 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: class a { public: int b(int a()); }; int x(); void y() { a z; z.b(x); } The error message is: :3:8: error: return type specification for constructor invalid

[Bug c++/90794] New: adding -O3 leads to crash

2019-06-08 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: #include int run(int sz) { typedef double MAT[sz][sz]; MAT *a; a = (MAT*) malloc(sizeof(MAT)); return (a==0); } int main(int argc, char* argv[]) { return

[Bug c++/90793] New: adding -fPIC leads to compilation error

2019-06-08 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: void f(void) { __asm volatile("" : : "i" (f)); } It compiles well, but after adding -fPIC, I got a message: source>: In f

[Bug c++/90791] New: -Os accepts wrong code

2019-06-08 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: void x() { int a; __asm__ ( "%0 %1" :"=r"(a)); } gcc accepts the code with the following parameters: gcc -Os | gcc -O3 | gcc -O1 | g++ -Os

[Bug c++/90790] New: Using override on a private overridden destructor shall produce an error

2019-06-08 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: This code: class Base { virtual ~Base() = default; }; class Derived : public Base { ~Derived

[Bug c++/90789] gcc complains cannot capture 'f()()' by reference on valid code

2019-06-08 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90789 zhonghao at pku dot org.cn changed: What|Removed |Added Summary|gcc |gcc complains cannot

[Bug c++/90789] New: gcc

2019-06-08 Thread zhonghao at pku dot org.cn
gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: ---

[Bug c++/90776] g++ -fms-extensions is inconsistent with Microsoft's compiler

2019-06-07 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90776 --- Comment #3 from zhonghao at pku dot org.cn --- Shall g++ be compatible with Microsoft's compiler, when -fms-extensions is set? (In reply to Jonathan Wakely from comment #2) > Why do you think either of these should be accepted?

[Bug c++/90776] g++ -fms-extensions is inconsistent with Microsoft's compiler

2019-06-06 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90776 --- Comment #1 from zhonghao at pku dot org.cn --- Another code sample: typedef union __declspec(align(64)) foo_t { double a[8]; } foo_t; foo_t bar;

[Bug c++/90776] New: g++ -fms-extensions is inconsistent with Microsoft's compiler

2019-06-06 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is: typedef struct a {} A; void f() { if (__builtin_alignof(A)) ; } g++ -fms-extensions rejects the code: error

[Bug c++/90775] New: A inconsistent compilation result

2019-06-06 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My g++ is 10.0.0, and my code is as follows: #include #include struct S {}; int begin(S); template std::true_type has_cbegin(decltype(std::cbegin(T{}))); template std::false_type

[Bug c++/86503] Segmentation fault signal terminated

2018-08-08 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86503 --- Comment #3 from zhonghao at pku dot org.cn --- (In reply to Richard Biener from comment #1) > You run out of memory or stack. Try ulimit -s unlimited I tried ulimit -s unlimited. This time, the error messages are as follows:

[Bug c++/86181] static object mangling conflicts

2018-08-07 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86181 --- Comment #2 from zhonghao at pku dot org.cn --- I reported the code to llvm. A developer of llvm said: Clang follows the agreed direction for CWG issue 1839, which says that redeclaration lookup for 'extern int i;' finds the 'static int i

[Bug middle-end/86718] [9 Regression] ICE during RTL pass: expand

2018-08-06 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86718 --- Comment #2 from zhonghao at pku dot org.cn --- My gcc: gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc9.0

[Bug c/86729] New: address of vector element requested

2018-07-30 Thread zhonghao at pku dot org.cn
Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- gcc accepts the following code: void a() { typedef float v4sf __attribute__ ((vector_size (16))); static v4sf q; float* r = [0]; } clang rejects it: clang code1.c code1.c:4:13: error

[Bug c/86721] New: use of undeclared identifier

2018-07-29 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: void g() { __builtin_printf( u8R"abcd(%.)abcd" "*d"); } gcc accepts it, but clang rejects it: code1.c:3:2: error: use of undeclared identifier

[Bug c/86720] New: Missing symbol name in directive

2018-07-29 Thread zhonghao at pku dot org.cn
Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: unsigned char foo (unsigned char x) { static volatile unsigned char P1OUT __asm ("0x0021"); unsigned char tmp = P1OUT; P1OUT = x; return tmp; } cla

[Bug c/86719] New: case label does not reduce to an integer constant

2018-07-29 Thread zhonghao at pku dot org.cn
: c Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code sample is as follow: int main(void) { const int nFOO = 1; int nFoo = 0; switch(nFoo){ case nFOO: exit(1); } exit(0); } gcc rejects the code: gcc code1.c

[Bug c/86718] New: ICE during RTL pass: expand

2018-07-29 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: void __attribute__((noinline, noclone)) test(char *data, __SIZE_TYPE__ len) { static char const appended[] = "/./"; char *buf = __builtin_alloca (len + sizeo

[Bug c/86716] New: use of parameter outside function body before ‘++’ token

2018-07-28 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: #include int f (int a, int b[a++], int c, int d[c++]) { printf ("%d %d\n", a, c); } int main (void) { int dum

[Bug middle-end/86715] New: ICE passing too large argument on stack

2018-07-28 Thread zhonghao at pku dot org.cn
Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: #define COLS 24000L struct Matrix { float data[COLS * COLS]; }; float mulv(float A[], float B[], int i, int j) { float result = 0.0; { int k

[Bug c/86709] New: 'short type-name' is invalid

2018-07-27 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- gcc allows ``short'' to appear with a typedef'd char: typedef unsigned char __u8; __u8 short slot_tablelen; is accepted, but unsigned char short slot_tablelen; is not, which doesn't make sense

[Bug c++/86665] New: declaration conflicts with target of using declaration already in scope

2018-07-24 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: namespace Name { template class Point; } using Name::Point; template class Point { public: Point

[Bug c++/86652] pointer to function type cannot have 'const' qualifier

2018-07-23 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86652 --- Comment #1 from zhonghao at pku dot org.cn --- A related code sample: class C { public: template int (*f())() const; }; int foo(C c) { return (*c.f())(); } The messages from clang++: error: pointer to function type cannot have 'const

[Bug c++/86652] New: pointer to function type cannot have 'const' qualifier

2018-07-23 Thread zhonghao at pku dot org.cn
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: class C { public: template int (*f())() const; }; g++ accepts the code, but clang++ rejects it: code4.cpp:4:7: error: pointer

[Bug c++/86633] New: invalid with rvalue references

2018-07-22 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: int x = reinterpret_cast(1.0f); Consensus on IRC is that this is invalid. g++ accepts it, but clang++ rejects it: code0.cpp:1:9: error: reinterpret_cast from rvalue

[Bug c++/86602] New: need to check for a placeholder in argument to noexcept

2018-07-20 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ accepts this invalid code: void f(); void f(int); bool b = noexcept(f); [over.over]p1: "An overloaded function name shall not be used wi

[Bug c++/86601] New: g++ accepts 'friend' at ill-formed positions in the decl-specifier-seq

2018-07-20 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ accepts this: struct S { class T friend; unsigned friend char; }; Both of these are illegal by [class.friend]p3

[Bug c++/86600] New: Class declaration in the same declarative region as using declaration - Missing diagnostic message

2018-07-20 Thread zhonghao at pku dot org.cn
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The following program should give a diagnostic message when trying to compile it. namespace X { class

[Bug c++/86598] New: Incorrect lexing of pp-numbers in C++11 due to hexfloat extension

2018-07-19 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ support C99 hexadecimal literals as an extension in its C++ modes. This is *almost* a conforming extension in C++98 mode, but it's far

[Bug c++/86596] New: non-type template argument evaluates to an integer

2018-07-19 Thread zhonghao at pku dot org.cn
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template struct A {}; typedef A<255> B; int main() { return 0; } g++ accepts the code, but clang++ rejects it: char.cpp:3:11: error: no

[Bug c++/86594] New: Crash on trying to capture 'this' in instantiation of generic lambda

2018-07-19 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: #include template constexpr void for_sequence(std::integer_sequence, F&& f) { using unpack

[Bug c++/86583] New: exception specification of explicitly defaulted destructor does not match the calculated one

2018-07-18 Thread zhonghao at pku dot org.cn
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct T { T() noexcept(false) { } ~T() noexcept(false) { } }; struct

[Bug c++/86581] New: constexpr variable is not checked

2018-07-18 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template struct V { union { int n; struct { int x,y; }; }; constexpr V() : x(0) {} }; constexpr V v; g++ does not check whether v is initialized. Instead, clang

[Bug c++/86580] New: No warning for default arguments

2018-07-18 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct S { S(const S&, int); S(int); }; S::S(const S& = S(0), int = 0) {} g++ accepts without any warning messages. Instead, clang++ reports: code0.cpp:1:5

[Bug c++/86579] New: invalid operands to binary expression

2018-07-18 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template bool greater() { T p = nullptr; return p > nullptr; } int main () { greater(); } g++ accepts it, but clang++ reports a error message: code0.cp

[Bug c++/86578] New: requested alignment is dependent but declaration is not dependent

2018-07-18 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template void Fun(T A) { typedef int __attribute__((__aligned__(A))) T1; int k1[__alignof__(T1)]; } g

[Bug c++/86577] New: non-ADL name lookup for operator<< at instantiation time?

2018-07-18 Thread zhonghao at pku dot org.cn
normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: #include namespace N { struct X { }; } using namespace N; template void log(const T& t) { std:

[Bug c++/86565] New: failing to instantiate all of a local class

2018-07-17 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template void f() { struct S { void g(int n = T::error) noexcept(T::error); }; } template void f(); g++ accepts it, but clang++ rejects it: code0.cpp:2

[Bug c++/86564] New: Declaration containing qualified-id interpreted as function-style cast

2018-07-17 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct foo { static bool const value = false; }; int main() { int v(int(foo::value)); } g++ accepts

[Bug c++/86563] New: catch reference to incomplete type

2018-07-17 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct T; template void f() { try {} catch(T const &) {} } struct T {}; int main() { f(); return 0; } g++ accepts, but clang++ rejects it: code0.cpp:

[Bug c++/86562] New: Missing warning (error in C++11) for passing nontrivial object to varargs function via function pointer

2018-07-17 Thread zhonghao at pku dot org.cn
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct Foo { Foo() {} Foo(const Foo&) {} }; vo

[Bug c++/86561] New: a function definition must occur in a standalone declaration

2018-07-17 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct S { int f(), g() = delete; }; g++ accepts the code, but clang++ rejects it: error: '= delete' is a function

[Bug c++/86558] New: ICE on template code

2018-07-17 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template struct VI {}; template struct IP { static const bool r = IP::r; }; template struct V { VI::r> vi; }; struct X; struct Y { V v; }; g++ produces the follow

[Bug c++/86503] New: Segmentation fault signal terminated

2018-07-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template< bool c, class T > struct enable_if { typedef T type; }; template< class T > struct enable_if< true, T > {}; template< class

[Bug c++/86502] New: friend declaration specifying a default argument must be a definition

2018-07-11 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: class Test { friend const int getInt(int inInt = 0); }; g++ accepts it, but clang++ rejects it: error

[Bug c++/86501] New: shadow template parameter

2018-07-11 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: template < int V > struct A { struct B { template < int > friend struct V; }; }; A < 0 >::B a; g++ accepts the code, but clang++ rejects it:

[Bug c++/86500] New: accepts-invalid with :: before decltype

2018-07-11 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ incorrectly accepts this: struct S { struct T {}; }; ::decltype(S())::T st; clang++ rejects it: error: expected unqualified-id

[Bug c++/86499] New: lambda-expressions with capture-default are allowed at namespace scope

2018-07-11 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ incorrectly accepts this: auto l = [=]{}; Per C++1y [expr.lambda]p9 this is ill-formed: only local lambda expressions may

[Bug c++/86498] New: g++ allows conversion from string literal to non-const char* in C++11 mode

2018-07-11 Thread zhonghao at pku dot org.cn
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ rejects this valid C++11 code: void f(char*); int (...); int = f("foo"); There is no conversion f

[Bug c++/86478] New: Crashed on legal code

2018-07-10 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: template struct X {}; template void foo(X... a); void test() { foo(X(), X()); } g++ crashes when compiling the code: code0.cpp: In substitution of 'template void foo(X

[Bug c++/86477] New: failure binding reference to vector element

2018-07-10 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: typedef __attribute__((ext_vector_type(4))) int vi4; const int = vi4(1).x; g++ rejects it: error: request for member 'x' in '1', which is of non-class

[Bug c++/86476] New: Members declared later in a class appear to be unavailable

2018-07-10 Thread zhonghao at pku dot org.cn
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: template struct A { void f() noexcept(noexcept(m.f())) { m.f(); } T m; }; struct B { void f(); }; int main

[Bug c++/86475] New: CWG 1550

2018-07-10 Thread zhonghao at pku dot org.cn
at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- I looked around to see if a bug was already filed on this and couldn't find one. CWG 1550, passed in Bristol, changes the value category of the result of a conditional operator when one operand is an lvalue

[Bug c++/86474] New: a problem in member lookup?

2018-07-10 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: namespace PR5820 { struct Base {}; struct D1 : public Base {}; struct D2 : public Base {}; struct Derived : public D1, public D2 { void Inner() { } }; } template

[Bug c++/86473] New: a problem in member lookup?

2018-07-10 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follows: namespace PR5820 { struct Base {}; struct D1 : public Base {}; struct D2 : public Base {}; struct Derived : public D1, public D2 { void Inner() { } }; } template

[Bug c++/86431] New: Legal code?

2018-07-06 Thread zhonghao at pku dot org.cn
at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct A { static int const B = sizeof B; }; g++ rejects the code: error: 'B' was not declared in this scope static int const B = sizeof B; The PoD should should be immediately

[Bug c++/86430] New: ambiguous overload?

2018-07-06 Thread zhonghao at pku dot org.cn
: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: // snip template struct Const { typedef void const type; }; template void f(T, typename Const::type*) { } // T1 template void f(T, void const *) { } // T2 int main() { void

[Bug c++/86385] New: calling wrong constructors?

2018-07-03 Thread zhonghao at pku dot org.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: struct A { int* a; A(int a) : a(new int(a)) {} ~A() { delete a; } A(const A&) = delete; A(A&& other) { a = other.a; other.a = 0; }; operator bool() {

[Bug c++/86384] New: Scoped enumeration instantiated even if not required

2018-07-03 Thread zhonghao at pku dot org.cn
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- The code is as follow: template struct A { enum class B { X = T::value }; }; int main() { A a; } g++ error: code0.c.cpp:4:13: error: 'value' is not a member

[Bug c++/86306] Initializing atomic qualified type with another atomic qualified type leads to assertion failure

2018-06-25 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86306 --- Comment #9 from zhonghao at pku dot org.cn --- (In reply to zhonghao from comment #8) > (In reply to Jonathan Wakely from comment #7) > > (In reply to Jonathan Wakely from comment #6) > > > Because you are just blindly copyi

[Bug c++/86306] Initializing atomic qualified type with another atomic qualified type leads to assertion failure

2018-06-25 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86306 --- Comment #8 from zhonghao at pku dot org.cn --- (In reply to Jonathan Wakely from comment #7) > (In reply to Jonathan Wakely from comment #6) > > Because you are just blindly copying things from one bugzilla to the other, > >

  1   2   >