[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++/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++/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 A

[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] 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 #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 correctl

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

2020-09-07 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 Status|UNCONFIRMED

[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/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] 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 shoul

[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/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/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/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/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/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/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/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/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/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/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 i

[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/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 t

[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) i

[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/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/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/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/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/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/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 Gra

[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 Resolution|INVALID

[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/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/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/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/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; &f == g; } Compilation command line: gcc pr

[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] 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 wit

[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 rel

[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 Anders Granlund changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[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/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] [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/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/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/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/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/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/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/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/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/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/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/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/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&R-style de

[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/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/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/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++/66878] New: Segmentation fault when compiling

2015-07-15 Thread anders.granlund.0 at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Created attachment 35987 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35987&action=edit prog.cc used in the command line With the attached file the following

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

2015-07-15 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: --- Created attachment 35988 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35988&action=edit prog.cc used

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

2015-07-15 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66879 --- Comment #3 from Anders Granlund --- Thanks for the comments! Now I remember the following bug report that I sent to clang: https://llvm.org/bugs/show_bug.cgi?id=24030 That bug has now been confirmed and fixed in clang, so yes this is the ac

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

2015-07-15 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: --- Created attachment 35990 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35990&action=edit

[Bug c++/66889] New: Accepting ill-formed program trying to define a struct via using-directive

2015-07-15 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: --- Created attachment 35991 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35991&action=edit prog.cc used

[Bug c++/66878] Segmentation fault when compiling

2015-07-15 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66878 --- Comment #3 from Anders Granlund --- The following bug that I also reported is related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66888

[Bug c++/66892] New: Fix of core language defect 355 has status c++11 but is not implemented yet

2015-07-15 Thread anders.granlund.0 at gmail dot com
: enhancement Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- The following core language defect has status c++11 but is not implemented yet: http://www.open-std.org/jtc1

[Bug c++/66900] New: No error message for ill-formed program with qualified name lookup

2015-07-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: --- Created attachment 35998 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35998&action=edit prog.cc used in the

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

2015-07-16 Thread anders.granlund.0 at gmail dot com
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: --- Created attachment 35999 --> ht

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

2015-07-18 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66888 --- Comment #2 from Anders Granlund --- This bug seems to be more general than struct definitions. It also exists for variable declarations like this: namespace X { extern int i; } namespace N { using X::i; } int N::i = 1; int main()

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

2015-07-18 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 since the two declarations in main are conflicting

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

2015-07-18 Thread anders.granlund.0 at gmail dot com
: UNCONFIRMED 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 well-formed. The two declarations in main are not conflicting. int

[Bug c++/66921] failure to determine size of static constexpr array that is nested within a templated class

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

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

2015-07-19 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66934 --- Comment #2 from Anders Granlund --- (In reply to Jonathan Wakely from comment #1) > I think we could combine most of your reports into one or two PRs since > they're all related and fixing them one by one would probably not be very > efficien

[Bug c++/66966] New: Missing diagnostic message for ill-formed program with anonymous enum

2015-07-22 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.cc): enum {}; int main() {} This is ill-formed according to [dcl.dcl]/5 of the

[Bug c++/66966] Missing diagnostic message for ill-formed program with anonymous enum

2015-07-22 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66966 --- Comment #3 from Anders Granlund --- (In reply to Jonathan Wakely from comment #2) > Oh wait ... if you use -w then you are suppressing diagnostics, so you can't > really complain that there are no diagnostics! > > So this seems invalid to me

[Bug c++/66966] Missing diagnostic message for ill-formed program with anonymous enum

2015-07-22 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66966 --- Comment #4 from Anders Granlund --- (In reply to Jonathan Wakely from comment #2) > Oh wait ... if you use -w then you are suppressing diagnostics, so you can't > really complain that there are no diagnostics! > > So this seems invalid to me

[Bug c++/66966] Missing diagnostic message for ill-formed program with anonymous enum

2015-07-22 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66966 Anders Granlund changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID

[Bug c++/66966] Missing diagnostic message for ill-formed program with anonymous enum

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

[Bug c++/66976] New: Compiler error for well-formed program with a definition of a constexpr function returning void

2015-07-23 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 (prog.cc in the command line below) is well-formed: constexpr void f

[Bug c++/66995] New: First declaration as inline after definition of function

2015-07-24 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.cc): void f() {} inline void f(); int main() {} It is ill-formed by [dcl.fct.spec]/4 (http

[Bug c++/67006] New: type-specifier const in declaration of anonymous union

2015-07-25 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 program (prog.cc): const union {}; int main() {} It is ill-formed by [dcl.type.cv] http://eel.is/c++draft/dcl.dcl#dcl.type.cv-1

[Bug c++/67008] New: Qualified name-lookup in using-declaration fails

2015-07-25 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 program: namespace N { int i; } using namespace N; using ::i; int main() {} Compile it with the following command line: Observe

[Bug c++/67008] Qualified name-lookup in using-declaration fails

2015-07-25 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67008 --- Comment #1 from Anders Granlund --- Forgot the command line: g++ prog.cc -std=c++14 -pedantic-errors

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

2015-07-25 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: namespace N { struct x {}; } using namespace N; int x; int

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

2015-07-25 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: int main() {}; It is well-formed, the extra semi colon is just an

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

2015-07-25 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67010 --- Comment #1 from Anders Granlund --- Detailed explanation of how the c++ standard can be applied to the program: By [namespace.udir]/2 during the unqualified name lookup of x in sizeof (x), the declaration struct x {}; appears as if it was de

[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 --- 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 it with the

[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 --- (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 this is a big incompatibility with c99 an

[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 --- (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 #2 from Anders Granlund --- (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 deduction for return types of functions

[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 --- (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 comment #2) > (In reply to Jonathan

[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 #5 from Anders Granlund --- (In reply to Jonathan Wakely from comment #4) > (In reply to Anders Granlund from comment #3) > > > I think that is because type deduction for return types of functions was > > > introduced in c++14. > > Y

[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 changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[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 --- *** Bug 66888 has been marked as a duplicate of this bug. ***

[Bug c++/66889] Accepting ill-formed program trying to define a struct via using-directive

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

[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 #6 from Anders Granlund --- *** Bug 66889 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 #7 from Anders Granlund --- (In reply to Jonathan Wakely from comment #4) > So confirming as accepts-invalid with this testcase: > > class A; > > namespace Y { > using ::A; > class A { }; > } Here are two similar test cases

  1   2   >