[Bug c++/97475] An unnamed class with a typedef name for linkage purposes having a method.

2021-08-05 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97475 --- Comment #4 from Anders Granlund --- Sounds good to me! On Thu, 5 Aug 2021, 13:35 redi at gcc dot gnu.org, wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97475 > > --- Comment #3 from Jonathan Wakely --- > Maybe we should make this

[Bug c++/97569] Declaring a struct in a field declaration of another struct. gcc and clang difference.

2020-10-28 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97569 Anders Granlund changed: What|Removed |Added Resolution|--- |INVALID

[Bug c++/97569] Declaring a struct in a field declaration of another struct. gcc and clang difference.

2020-10-25 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97569 --- Comment #2 from Anders Granlund --- (In reply to Jonathan Wakely from comment #1) > (In reply to Anders Granlund from comment #0) > > The interesting thing is that if we replace struct S with struct S {} > > both compilers agree on

[Bug c++/97569] New: Declaring a struct in a field declaration of another struct.

2020-10-25 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following c++ program: int main() { struct A { struct B *b; }; using U = B

[Bug c++/97479] New: Auto as template argument

2020-10-18 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program: template class A { }; int main() { A a = A(); } It is accepted when compiling it with "-std=c++20 -pedantic-errors". Th

[Bug c++/97475] New: An unnamed class with a typedef name for linkage purposes having a method.

2020-10-17 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following c++ program: typedef struct { void f(); } X; int main

[Bug c++/97375] Unexpected top-level const retainment when declaring non-type template paramter with decltype(auto)

2020-10-14 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97375 --- Comment #1 from Anders Granlund --- Here is another example of the same problem without using decltype(auto), so the problem seems to be more general: #include #include template void f1() { std::cout << std::is_const_v <<

[Bug c++/97376] New: Function type to function pointer type adjustment for non-type template paramter does not work when using decltype(auto)

2020-10-11 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program: #include

[Bug c++/97375] New: Unexpected top-level const retainment when declaring non-type template paramter with decltype(auto)

2020-10-11 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program: #include #include template void f1() { std

[Bug c++/97363] New: Missing diagnostics when trying to initialize rvalue reference variable with lvalue expression when using decltype(auto) type deduction.

2020-10-10 Thread anders.granlund.0 at gmail dot com via Gcc-bugs
Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program

[Bug c++/96884] Missing diagnostics when applying the member operator on this in class template

2020-09-08 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96884 Anders Granlund changed: What|Removed |Added Resolution|--- |INVALID

[Bug c++/96957] No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.

2020-09-08 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96957 --- Comment #2 from Anders Granlund --- Correction to my first comment: "GCC is correctly compiling the program with no error messages outputed. See the discussion in: https://bugs.llvm.org/show_bug.cgi?id=47435; should be: "Clang is

[Bug c++/96957] No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.

2020-09-07 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96957 --- Comment #1 from Anders Granlund --- Also see the following stack overflow post: https://stackoverflow.com/questions/63761866/difference-in-behaviour-between-clang-and-gcc-when-trying-to-confuse-them-by-usi

[Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.

2020-09-07 Thread anders.granlund.0 at gmail dot com
: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following c++ program: class

[Bug c++/96884] New: Missing diagnostics when applying the member operator on this in class template

2020-09-01 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Program (main.cpp): template class V { int *a; void f() { this.a = 0

[Bug c++/96852] New: Missing diagnostic message for friend declaration with wrong number of template arguments.

2020-08-30 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Program (main.cpp): template class A { }; class B { template friend class

[Bug c/88827] New: Rejects valid program using &* operator combination.

2019-01-13 Thread anders.granlund.0 at gmail dot com
: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): int main() { struct S *p = 0; &*p; } Compilation command line: gcc prog.c -Wall -Wextra -std=c11 -pedantic-errors

[Bug c/88647] Rejects valid program dereferencing pointer with incomplete reference type.

2019-01-13 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88647 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88822] New: Strange inconsistency between types of qualified rvalues.

2019-01-13 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): int main() { int * const p1 = 0; int * _Atomic p2 = 0; int * const _Atomic p3 = 0

[Bug c/88731] [DR 481] Rejects well-formed program using bit-fields in _Generic.

2019-01-12 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88731 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88704] Accepts invalid program with [*] outside function prototype scope.

2019-01-12 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88704 --- Comment #3 from Anders Granlund --- (In reply to Martin Sebor from comment #2) > Confirmed, although I'd be more inclined to invest energy into including > -Wstrict-prototypes in -Wall or -Wextra than into diagnosing the VLA in > K

[Bug c/88817] New: Diagnostics improvement: Does not detect attempt to use void expression in some cases.

2019-01-12 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): extern void v; int main(void) { _Generic(v, default: 0); } Compilation

[Bug c/88774] Qualification of parameters does not change a function type: Bug or standard defect?

2019-01-10 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88774 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88774] New: Qualification of parameters does not change a function type: Bug or standard defect?

2019-01-09 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): int main(void) { typedef void f(int); typedef void f(const int

[Bug c/88731] New: Rejects well-formed program using bit-fields in _Generic.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): int main() { struct S { unsigned x:4; } s; _Generic(s.x, unsigned: 0); } Compilation command line

[Bug c/88727] New: Diagnostics improvement: Detection of undefined behaviour. Incomplete type in tenative definition with internal linkage.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): static struct S s; int main

[Bug c/88726] New: GCC thinks that translation unit does not contain a definition of inline function.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (test.c): int main() { extern inline void f(); } void f() { } Compilation command line

[Bug c/88720] New: Strange error message about nested function declared but not defined when using inline.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): static void f(); int main() { inline void f(); } Compilation command line

[Bug c/88718] New: Strange inconsistency between old style and new style declarations of iinline functions.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- GCC is behaving inconsistently for the following two test cases: prog1.c: static int x; inline void g

[Bug c/88584] GCC thinks that the type is complete dispite shaddowing.

2019-01-06 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88584 --- Comment #7 from Anders Granlund --- (In reply to jos...@codesourcery.com from comment #6) > This looks like a case that was missed in, or broken by, my fix for bug > 13801, which was supposed to address such cases of entities with different

[Bug c/88716] New: Improved diagnostics: No detection of conflicting function definitions in some cases.

2019-01-06 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following two test cases (prog1.c): void f(x) int x; { } void f(int, int); void f

[Bug c/88704] New: Accepts invalid program with [*] outside function prototype scope.

2019-01-04 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): void f(a) int a[*]; { } int main() { } Compilation command line: gcc prog.c -std=c11

[Bug c/88701] [9 Regression] Internal compiler error for valid program using compound literal with variably modified type.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88701 --- Comment #4 from Anders Granlund --- Thanks for the bisect.

[Bug c/88701] Internal compiler error for valid program using compound literal with variably modified type.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88701 --- Comment #1 from Anders Granlund --- Another test case that also gives internal compiler error with the same compilation command line: void f(int n, int [(int (*)[n]) { 0 } == 0]); int main() { }

[Bug c/88701] New: Internal compiler error for valid program using compound literal with variably modified type.

2019-01-04 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): void f(int [(int (*)[*]) { 0 } == 0]); int main() { } Compilation command

[Bug c/88695] Accepts invalid program with incompatible function types.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88695 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88647] Rejects valid program dereferencing pointer with incomplete reference type.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88647 --- Comment #4 from Anders Granlund --- (In reply to jos...@codesourcery.com from comment #1) > 6.3.2.1#2 (conversion of lvalues to rvalues): "If the lvalue has an > incomplete type and does not have array type, the behavior is undefined.". >

[Bug c/88695] Accepts invalid program with incompatible function types.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88695 --- Comment #4 from Anders Granlund --- (In reply to Jonathan Wakely from comment #2) > See PR 64526 and DR 317. (Forgot to reply instead of adding an additional comment) Yes, the type of f does have a prototype. That fact is however not

[Bug c/88695] Accepts invalid program with incompatible function types.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88695 --- Comment #3 from Anders Granlund --- Yes, the type of f does have a prototype. That fact is however not relevant here. Note that I'm not making any calls to f here. I am only using f in a way that requires its type to be compatible

[Bug c/88695] Accepts invalid program with incompatible function types.

2019-01-04 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88695 --- Comment #1 from Anders Granlund --- Correction: The second standard reference should be 6.7.6.3/15 and not 6.7.3/15.

[Bug c/88695] New: Accepts invalid program with incompatible function types.

2019-01-04 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): void f() { } int main() { void (*g)(int) = 0; == g; } Compilation command line: gcc prog.c

[Bug c/88674] GCC thinks that register is a qualifier in function declaration with no parameters.

2019-01-03 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88674 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88674] New: GCC thinks that register is a qualifier in function declaration with no parameters.

2019-01-03 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): void f(register void); int main() { } Compilation command line: gcc prog.c

[Bug c/88667] Accepts program with invalid abstract-declarator grammar.

2019-01-02 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88667 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88667] New: Accepts program with invalid abstract-declarator grammar.

2019-01-02 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): void f(int [const *]); int main() {} Compilation command line: gcc prog.c -Wall -Wextra -std=c11 -pedantic

[Bug c/88647] Rejects valid program dereferencing pointer with incomplete reference type.

2019-01-02 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88647 Anders Granlund changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug c/88582] GCC does not unqualify return types in the case of _Atomic qualified return type.

2019-01-02 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88582 Anders Granlund changed: What|Removed |Added Resolution|WONTFIX |INVALID --- Comment #5 from Anders

[Bug c/88647] Rejects valid program dereferencing pointer with incomplete reference type.

2019-01-02 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88647 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88647] New: Rejects valid program dereferencing pointer with incomplete reference type.

2019-01-01 Thread anders.granlund.0 at gmail dot com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): struct S *p; void f(void); int main() { f(); *p; } struct S { int x

[Bug c/88582] GCC does not unqualify return types in the case of _Atomic qualified return type.

2018-12-31 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88582 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88642] New: Accepts ill-formed program with invalid scalar initialization syntax.

2018-12-31 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test program (test.c): int main() { int x = { { 0 } }; } Compilation command line: clang prog.c -Wall -Wextra

[Bug c/88625] c11: GCC Allows enumerator value not representable in type int.

2018-12-27 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88625 --- Comment #1 from Anders Granlund --- Forgot to include the include of a header file in the test case: #include enum E { x = UINT_MAX }; int main() { }

[Bug c/88625] New: c11: GCC Allows enumerator value not representable in type int.

2018-12-27 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): enum E { x = UINT_MAX }; int main() { } Compilation command line: gcc prog.c -Wall -Wextra -std=c11

[Bug c/88584] GCC thinks that the type is complete dispite shaddowing.

2018-12-23 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88584 --- Comment #4 from Anders Granlund --- (In reply to Andrew Pinski from comment #3) > http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_011.html To me it looks like the resolution of that defect report (and the current wording of the standard)

[Bug c/88582] GCC does not unqualify return types in the case of _Atomic qualified return type.

2018-12-23 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88582 --- Comment #2 from Anders Granlund --- Quote from the C17 standard (the bugfix version of C11) 6.7.6.3/5: If, in the declaration “T D1”, D1 has the form D(parameter-type-list) or D(identifier-list[opt]) and the type specified for ident in

[Bug c/88581] GCC thinks that

2018-12-23 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88581 --- Comment #3 from Anders Granlund --- Yes. That is correct.

[Bug c/88584] GCC thinks that the type is complete dispite shaddowing.

2018-12-23 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88584 --- Comment #2 from Anders Granlund --- By "merging" i suppose you mean the process described at 6.2.7.4 in the standard: "For an identifier with internal or external linkage declared in a scope in which a prior declaration of that identifier

[Bug c/88584] New: GCC thinks that the type is complete dispite shaddowing.

2018-12-23 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test program (prog.c): int a[1] = { 0 }; int main() { int a; { extern int a[]; sizeof (a); } } Compilation

[Bug c/88582] New: GCC does not unqualify return types in the case of _Atomic qualified return type.

2018-12-23 Thread anders.granlund.0 at gmail dot com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case (prog.c): int main() { typedef _Atomic int f(); typedef int f(); } Compilation command

[Bug c/88581] New: GCC thinks that

2018-12-23 Thread anders.granlund.0 at gmail dot com
: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: ---

[Bug c/88477] Variable with type completed in initializer not allowed.

2018-12-18 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88477 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88526] gcc accepts ill-formed program with sizeof (int [*])

2018-12-18 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88526 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88525] gcc thinks that C11 program does not declare anything but it does.

2018-12-18 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88525 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/88525] gcc thinks that C11 program does not declare anything but it does.

2018-12-17 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88525 --- Comment #2 from Anders Granlund --- Thanks for the explanation. That makes sense.

[Bug c/88526] gcc accepts ill-formed program with sizeof (int [*])

2018-12-17 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88526 --- Comment #2 from Anders Granlund --- Thanks for the clarification. I'll report this bug for clang instead.

[Bug c/88526] New: gcc accepts ill-formed program with sizeof (int [*])

2018-12-16 Thread anders.granlund.0 at gmail dot com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following C11 program (prog.c): void f(int a[sizeof(int [*])]); int main() { } Compiling it with gcc prog.c -std=c11 -pedantic-errors

[Bug c/88525] New: gcc thinks that C11 program does not declare anything but it does.

2018-12-16 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following C11 program (prog.c): int main() { struct { enum { a } b; }; } This program does NOT violate

[Bug c/88477] Variable with type completed in initializer not allowed.

2018-12-16 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88477 --- Comment #4 from Anders Granlund --- In general the standard seems to be a bit inprecise when it talks about types beeing complete. The same type may be incomplete at one point in the program, but complete at another point. The standard

[Bug c/88477] Variable with type completed in initializer not allowed.

2018-12-12 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88477 --- Comment #2 from Anders Granlund --- To what part of the standard are you refering to? This is what I found and it allows the given program: C11 standard 6.7.7: https://port70.net/~nsz/c/c11/n1570.html#6.7p7

[Bug c/88477] New: Variable with type completed in initializer not allowed.

2018-12-12 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program (prog.c): int main() { struct S s = (struct S { int x; }) { .x = 1 }; } The type of s is completed

[Bug c++/67166] New: Inconsistency between static data members and static functions when using multiple inheritance

2015-08-09 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following two programs: struct A { static const int x = 0; }; struct B

[Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function

2015-07-30 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67065 --- Comment #3 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #1) (In reply to Anders Granlund from comment #0) The following program is ill-formed (proc.cc): int main; Compile

[Bug c++/67074] New: Name lookup ambiguity between namespace and its alias

2015-07-30 Thread anders.granlund.0 at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Test case: namespace P{ namespace X { static int i = 1; } } namespace Q { namespace X = P::X; } using namespace P; using namespace Q; int main

[Bug c++/67074] Name lookup ambiguity between namespace and its alias

2015-07-30 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67074 --- Comment #1 from Anders Granlund anders.granlund.0 at gmail dot com --- I have reported the same bug in clang also: https://llvm.org/bugs/show_bug.cgi?id=24324 Richard Smith confirmed it and added this additional test case: And likewise

[Bug c++/67065] Missing diagnostics for ill-formed program with main variable instead of function

2015-07-30 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67065 --- Comment #2 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #1) (In reply to Anders Granlund from comment #0) The following program is ill-formed (proc.cc): int main; Compile

[Bug c++/67065] New: Missing diagnostics for ill-formed program with main variable instead of function

2015-07-30 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- The following program is ill-formed (proc.cc): int main; Compile it with the following command line

[Bug c++/67010] Name hiding in the same declarative region fails when done via using-directive

2015-07-29 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67010 Anders Granlund anders.granlund.0 at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED

[Bug c++/67047] GCC accepts ill-formed program with enumerator not representable in uintmax_t

2015-07-29 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67047 --- Comment #5 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #4) Yes you can verify that with static_assert( std::is_samestd::underlying_typedecltype(x)::type, unsigned __int128::value

[Bug c++/67047] GCC accepts ill-formed program with enumerator not representable in uintmax_t

2015-07-28 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67047 --- Comment #3 from Anders Granlund anders.granlund.0 at gmail dot com --- It seems like the increment of the enumerator x triggered the use of the following compiler extension: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html

[Bug c++/67047] New: GCC accepts ill-formed program with enumerator not representable in uintmax_t

2015-07-28 Thread anders.granlund.0 at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program (prog.cc): #include cstdint #include limits enum { x = std::numeric_limitsstd

[Bug c++/67047] GCC accepts ill-formed program with enumerator not representable in uintmax_t

2015-07-28 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67047 --- Comment #2 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Andrew Pinski from comment #1) So the enum is an unsigned type so UINTMAX_MAX +1 is 0 as it is always representable due to the rules of unsigned types

[Bug c++/67026] GCC incorrectly rejects well-formed constexpr function definition

2015-07-28 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67026 --- Comment #3 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Andrew Pinski from comment #2) Actually wait. I think this is invalid and clang is incorrect in not rejecting it. Because you have a call to a non

[Bug c++/67048] New: GCC rejects well-formed program using empty anonymous enum specifier in a variable declaration

2015-07-28 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following well-formed program (prog.cc): enum {} x; int main() {} Compile

[Bug c++/67017] Mixing init-declarator for variables and functions in declaration with auto type-specifier

2015-07-27 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67017 --- Comment #6 from Anders Granlund anders.granlund.0 at gmail dot com --- Now I got the reply. It seems like the wording of the standard changed with the resolution of this c++ standard core defect: http://www.open-std.org/jtc1/sc22/wg21/docs

[Bug c++/67026] New: GCC incorrectly rejects well-formed constexpr function definition

2015-07-27 Thread anders.granlund.0 at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program (proc.cc): void g() {} constexpr void f() { return; g(); } int main() {} Compile

[Bug c++/67016] New: Redeclaration of enum

2015-07-26 Thread anders.granlund.0 at gmail dot com
: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program: enum E {}; enum E; int main() {} Compile it with the following command line: g++ prog.cc -std=c++98 -pedantic-errors No error messages are given

[Bug c++/67013] Compilation error for well-formed program with empty declaration in the global namespace

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67013 --- Comment #2 from Anders Granlund anders.granlund.0 at gmail dot com --- That comment seems to be incorrect. The c++ standard has never forbidden empty declarations at global namespace. I think we should get a warning instead of an error.

[Bug c++/67017] New: Mixing init-declarator for variables and functions in declaration with auto type-specifier

2015-07-26 Thread anders.granlund.0 at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Consider the following program (prog.cc): auto i = 0, f(); int main() {} Compile

[Bug c++/67013] Compilation error for well-formed program with empty declaration in the global namespace

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67013 --- Comment #4 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #3) It might have changed between the ARM and C++98, but I haven't checked. Is ARM a c++ standard before c++98?

[Bug c++/67017] Mixing init-declarator for variables and functions in declaration with auto type-specifier

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67017 --- Comment #3 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #1) EDG and Clang also accept this in C++14 mode (and like GCC, reject it in C++11 mode). (In reply to Anders Granlund from

[Bug c++/67016] Redeclaration of enum

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67016 --- Comment #2 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Andrew Pinski from comment #1) Looks like this changed between c++11 and c++98. Note you are quoting c++11 but compiling with c++98. Also

[Bug c++/67017] Mixing init-declarator for variables and functions in declaration with auto type-specifier

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67017 --- Comment #2 from Anders Granlund anders.granlund.0 at gmail dot com --- (In reply to Jonathan Wakely from comment #1) EDG and Clang also accept this in C++14 mode (and like GCC, reject it in C++11 mode). I think that is because type

[Bug c++/66888] Compiler accepting ill-formed program trying to define a struct via using-declaration

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66888 Anders Granlund anders.granlund.0 at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED

[Bug c++/66879] Error message when defining a member function inside a class definition

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879 --- Comment #5 from Anders Granlund anders.granlund.0 at gmail dot com --- *** Bug 66888 has been marked as a duplicate of this bug. ***

[Bug c++/66879] Error message when defining a member function inside a class definition

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879 --- Comment #8 from Anders Granlund anders.granlund.0 at gmail dot com --- *** Bug 66901 has been marked as a duplicate of this bug. ***

[Bug c++/66901] Segmentation fault in compiler instead of error message for ill-formed program with namespace alias and qualified definition

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66901 Anders Granlund anders.granlund.0 at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED

[Bug c++/66934] Compiler accepting ill-formed program with extern variable declarations and using-declaration

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66934 --- Comment #4 from Anders Granlund anders.granlund.0 at gmail dot com --- I'm pulling in this test case from my related bug report. int x = 1; int main() { extern int x; using ::x; } I this case the program is well-formed

[Bug c++/66935] Compiler rejects well-formed program with local extern variable declaration and using-declaration

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66935 Anders Granlund anders.granlund.0 at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED

[Bug c++/66934] Compiler accepting ill-formed program with extern variable declarations and using-declaration

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66934 --- Comment #5 from Anders Granlund anders.granlund.0 at gmail dot com --- *** Bug 66935 has been marked as a duplicate of this bug. ***

[Bug c++/66879] Error message when defining a member function inside a class definition

2015-07-26 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879 --- Comment #10 from Anders Granlund anders.granlund.0 at gmail dot com --- Here comes two more test cases moved in from my related ICE on compile bug reports: namespace X { struct S; namespace Y { namespace Z = X; struct

  1   2   >