[Bug c++/62172] Operand to a throw expression is moved when it should be copied

2014-08-18 Thread ville.voutilainen at gmail dot com
||2014-08-18 CC||ville.voutilainen at gmail dot com Ever confirmed|0 |1 --- Comment #1 from Ville Voutilainen --- Reduced: #include int move_count = 0; struct X { X() = default; X(const X&) = def

[Bug c++/62101] New: deleted definitions of friend functions are rejected

2014-08-11 Thread ville.voutilainen at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: struct X { friend void f(X, int) = delete; friend void f(X, double) {} }; struct Y; void g(Y, int); void g(Y, double); struct Y { friend void g(Y, int) = delete

[Bug c++/61857] New: An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-07-20 Thread ville.voutilainen at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com struct A { A(int val){} }; int main() { A a{ [x=123]{ return x; }() }; } init-capture2.cpp: In function ‘int main()’: init

[Bug c++/61856] New: Ternary operator in an NSDMI causes double evaluation

2014-07-20 Thread ville.voutilainen at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com First test: #include #ifdef OK struct ostream { } cout; bool operator<<(ostream&, const char* s) { __builtin_printf("%s", s); return true; } #else using std::co

[Bug c++/58972] Lambda can't access private members

2014-06-26 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972 --- Comment #6 from Ville Voutilainen --- (In reply to Jonathan Wakely from comment #5) > Seems to be fixed on trunk, probably by Ville's fix for protected members. Yes, that fix is for 59483, I didn't wish to have these as duplicates because wh

[Bug c++/61491] An explicit specialization of a member enumeration of a class template is rejected

2014-06-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61491 --- Comment #1 from Ville Voutilainen --- This is part of DR1206: http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1206

[Bug c++/61491] New: An explicit specialization of a member enumeration of a class template is rejected

2014-06-12 Thread ville.voutilainen at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com #include template struct Base { enum class E : unsigned; E e; Base(E e) : e(e) {} }; struct X; template<>

[Bug c++/59483] A nested lambda fails to find a protected name with qualified name

2014-06-04 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59483 --- Comment #3 from Ville Voutilainen --- So, correction, the original testcase in 58972 is fixed by this patch, but the other testcase in it ICEs the compiler. That testcase is not really related to the issue the patch fixes, or the patch itself

[Bug c++/58972] Lambda can't access private members

2014-06-03 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972 --- Comment #3 from Ville Voutilainen --- [ville@localhost ~]$ g++ --std=c++11 -c dan.cpp dan.cpp: In instantiation of ‘struct derive::foo(base::type) [with T = char; base::type = int]::f_t’: dan.cpp:18:5: required from ‘void derive::foo(base:

[Bug c++/58972] Lambda can't access private members

2014-06-03 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail dot com

[Bug c++/59483] A nested lambda fails to find a protected name with qualified name

2014-06-03 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59483 --- Comment #2 from Ville Voutilainen --- It seems that 58972 is a duplicate, and is fixed by the same patch.

[Bug c++/61133] g++ doesn't implement DR1760

2014-05-19 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61133 --- Comment #1 from Ville Voutilainen --- Patch is in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00656.html

[Bug c++/58753] Brace-initializing a vector with a direct-initialization NSDMI doesn't work in a template

2014-05-15 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58753 --- Comment #13 from Ville Voutilainen --- (In reply to Paolo Carlini from comment #12) Ah, indeed, comment 2 has an explicit diagnostic as well. The patch looks reasonable (to my taste the condition doesn't, but that's another matter), so I rec

[Bug c++/58753] Brace-initializing a vector with a direct-initialization NSDMI doesn't work in a template

2014-05-15 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58753 --- Comment #11 from Ville Voutilainen --- (In reply to Paolo Carlini from comment #10) Looks somewhat similar, but not identical. In this particular bug it doesn't seem to be a case of explicitness being the problem.

[Bug c++/61133] New: g++ doesn't implement DR1760

2014-05-09 Thread ville.voutilainen at gmail dot com
nt: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Testcase: int main() { auto x = [y = 5](){}; auto z = x.y; } The member should not be usable. The most recent WP says "An init-capture behaves as if it declares and explicitly captures a varia

[Bug c++/51501] [DR 1433] decltype over-agressive SFINAE

2014-05-08 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51501 --- Comment #10 from Ville Voutilainen --- (In reply to Jason Merrill from comment #9) > Ville, has EWG taken a look at this issue? I'm sorry this didn't come up in Not yet. The handling of Extension-status Core Issues was more or less on hold w

[Bug c++/51424] [C++11] G++ should diagnose self-delegating constructors

2014-04-28 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51424 --- Comment #8 from Ville Voutilainen --- My 2 cents is to open a separate bug if we want diagnostics for the more elaborate self-delegating cases.

[Bug c++/51424] [C++11] G++ should diagnose self-delegating constructors

2014-04-22 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51424 --- Comment #5 from Ville Voutilainen --- (In reply to Jakub Jelinek from comment #4) > GCC 4.9.0 has been released Well, shouldn't this bug be closed, then? The patch Paolo wrote was applied and shipped in 4.9.0, so this is already in, no need t

[Bug c++/60708] [4.8/4.9 Regression] An array temporary causes an ICE in gimplify

2014-03-31 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60708 --- Comment #3 from Ville Voutilainen --- So, to clarify, this is not accepts-invalid, nor is it a 4.7->4.9 regression with regards to whether the function should be accepted. If I change the test to be purely C++11, it ICEs on 4.7 and 4.8 as well

[Bug c++/60708] [4.8/4.9 Regression] An array temporary causes an ICE in gimplify

2014-03-31 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60708 --- Comment #2 from Ville Voutilainen --- Well, no - the error that 4.7 gives is caused by my using a C++14 deduced return type for a function there. 4.9 supports those with --std=c++1y.

[Bug c++/60708] New: An array temporary causes an ICE in gimplify

2014-03-30 Thread ville.voutilainen at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: template struct mypair { mypair(T, U) {} }; template auto my_make_pair(T t, U u) { return mypair(t, u); } template struct S { mypair get_pair() noexcept { return my_make_pair

[Bug c++/50025] [DR 1288] C++0x initialization syntax doesn't work for class members of reference type

2014-03-01 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50025 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail dot com

[Bug c++/59914] New: A variadic function template that forwards to a multi-pack variadic template causes an infinite loop

2014-01-23 Thread ville.voutilainen at gmail dot com
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com template void f(T&& t, int i, U&&... u) {} template void g(T&&... t) {g(t..., 5, t...);

[Bug c++/59838] ICE with an enum using an incomplete type

2014-01-17 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59838 --- Comment #5 from Ville Voutilainen --- Ah, of course, it will end up returning error_mark_node and then other machinery reports the error. Ok, looks quite good. Can you post it to gcc-patches, then?

[Bug c++/59838] ICE with an enum using an incomplete type

2014-01-17 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59838 --- Comment #3 from Ville Voutilainen --- Ok, but the patch needs to be massaged a bit to give an error in the case where the underlying type is not set, if the complain flag has error set. I can do that, seems simple enough.

[Bug c++/59838] New: ICE with an enum using an incomplete type

2014-01-15 Thread ville.voutilainen at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Very simple test: enum E { a, b = true ? 1 : ((E)a, 0) }; enumcrash.cpp:1:32: internal compiler error: Segmentation fault enum E { a, b = true ? 1 : ((E)a, 0

[Bug c++/59701] A variadic alias template aliasing another variadic alias template doesn't work

2014-01-10 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59701 --- Comment #1 from Ville Voutilainen --- The testcase caused an ICE in recent versions of clang, and was fixed so that the code is rejected by clang. This is related to Core Issue 1430, so the bug should probably be on hold until CWG decides the

[Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work

2014-01-06 Thread ville.voutilainen at gmail dot com
erity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com template struct foo { }; template using bar = foo; template using baz = bar; int main (int argc, char *argv[]) { } This gives ed

[Bug c++/59702] New: Infinite recursion in a late-specified return type of a function template

2014-01-06 Thread ville.voutilainen at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com struct A {}; template int func (A) { return {}; } template auto func () -> decltype (func (A{})) { return {}; } int main (int argc, c

[Bug c++/59702] Infinite recursion in a late-specified return type of a function template

2014-01-06 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59702 --- Comment #1 from Ville Voutilainen --- I forgot to mention that clang accepts the code.

[Bug c++/59686] Non-constexpr pointers accepted in constant expressions

2014-01-05 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686 --- Comment #1 from Ville Voutilainen --- (In reply to Ville Voutilainen from comment #0) > int main > { > static const int x = 5; > const int * const y = &x; > static_assert(y, ""); > } > > clang rejects this, gcc accepts. well, typ

[Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions

2014-01-05 Thread ville.voutilainen at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com int main { static const int x = 5; const int * const y = &x; static_assert(y, ""); } clang rejects this, gcc accepts.

[Bug c++/59676] New: Non-integral glvalues accepted in constant expressions

2014-01-04 Thread ville.voutilainen at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com constexpr int foo(float f) {return int(f);} int main() { const float x = 0.5; static_assert(x > 0.1, "all good"); // #1 constexpr int i = foo(x); // #2 }

[Bug c++/59482] A friend class cannot inherit a private nested class

2013-12-12 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59482 --- Comment #1 from Ville Voutilainen --- A friend function can access the private class, thus void f(); struct B { friend void f(); private: struct C {};}; void f() { struct D : B::C{}; } Some analysis follows: I investigated t

[Bug c++/59483] New: A nested lambda fails to find a protected name with qualified name

2013-12-12 Thread ville.voutilainen at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: struct X { protected: int i; }; struct Y: X { void f() { [&]{ X::i = 3; }(); } // #1 }; Output: eelis.cpp: In lambda func

[Bug c++/59482] New: A friend class cannot inherit a private class

2013-12-12 Thread ville.voutilainen at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: struct aa { friend struct cc; private: struct bb {}; }; struct cc : aa::bb {}; Output: ville.cpp:1:47: error: ‘struct aa::bb’ is private struct aa { friend struct cc

[Bug c++/59481] New: late-specified return type using a parameter pack doesn't work with a recursive function template

2013-12-12 Thread ville.voutilainen at gmail dot com
IRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test snippet: template int func (T) { return 0; } template auto func (T t, Ts... ts) -> decltype (

[Bug c++/59457] name mangling in presence of variadic templates seems wrong

2013-12-10 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59457 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail dot com

[Bug c++/59416] New: A nested template reusing the template arguments of the enclosing type in a template template argument not working

2013-12-07 Thread ville.voutilainen at gmail dot com
: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: template struct Obj; template struct A { template class> struc

[Bug c++/59366] New: A friend function template defined in a class is found without ADL

2013-12-02 Thread ville.voutilainen at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Reduced test: struct X { //friend void f(int) {} // #1 template friend void f(T) {} // #2 }; int main() { f(5); // #3 } The function in

[Bug c++/58896] New: Incorrect handling of a private nested type of a template specialization in the main template

2013-10-27 Thread ville.voutilainen at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com This code compiles without any problem: template class Obj; template<> class Obj { struct secret{}; }; template

[Bug c++/58753] Brace-initializing a vector with a direct-initialization NSDMI doesn't work in a template

2013-10-21 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58753 --- Comment #8 from Ville Voutilainen --- Slightly reduced, I guess... #include template struct X {X(std::initializer_list) {}}; template class T { X x{1}; }; int main() { T t; } This gives plaatti-reduced2.cpp: In constructor ‘

[Bug c++/58761] ICE with a lambda capturing this in a NSDMI

2013-10-21 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58761 --- Comment #2 from Ville Voutilainen --- Reduced: template struct X { int x = 42; int y = [this](){return this->x;}(); }; int main() { X x; } Seems to require a template to trigger, but from that point onwards, it's quite easy to trigg

[Bug c++/55588] Failure to diagnose non-template-id prefixed by keyword template

2013-10-20 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55588 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail dot com

[Bug c++/51851] Overriding a function with a parameter of dependent type fails to override.

2012-01-13 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51851 --- Comment #1 from Ville Voutilainen 2012-01-13 19:13:13 UTC --- Johannes Schaub says "in both situations the question is whether the parameter type adjustments happen immediately or after instantiation (when T is replaced by the actual type)",

[Bug c++/51851] New: Overriding a function with a parameter of dependent type fails to override.

2012-01-13 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51851 Bug #: 51851 Summary: Overriding a function with a parameter of dependent type fails to override. Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNC

[Bug c++/50811] [C++0x] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier

2011-10-21 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50811 --- Comment #7 from Ville Voutilainen 2011-10-21 14:24:23 UTC --- (In reply to comment #6) > thanks! You're welcome! I don't like leaving bugs open in code I wrote, so instead of turning in early, I decided to fix it. ;) Just out of curiosity,

[Bug c++/50811] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier

2011-10-20 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50811 --- Comment #4 from Ville Voutilainen 2011-10-21 00:40:58 UTC --- Patch in http://gcc.gnu.org/ml/gcc-patches/2011-10/msg01914.html

[Bug c++/50811] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier

2011-10-20 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50811 --- Comment #3 from Ville Voutilainen 2011-10-20 23:48:15 UTC --- (In reply to comment #2) > It thus looks like it gets parsed as a class definition instead of a variable > definition. ..which is actually correct, pardon my ruminations, it just

[Bug c++/50811] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier

2011-10-20 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50811 --- Comment #2 from Ville Voutilainen 2011-10-20 23:34:06 UTC --- It thus looks like it gets parsed as a class definition instead of a variable definition.

[Bug c++/50811] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier

2011-10-20 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50811 --- Comment #1 from Ville Voutilainen 2011-10-20 23:26:57 UTC --- Oh my. struct C { int x; }; int main() { struct C final {}; int y = final.x; } says error: ‘final’ was not declared in this scope When it's just struct

[Bug c++/50169] "new struct X {{}};" incorrectly treated as an invalid struct-definition

2011-08-23 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50169 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail

[Bug c++/41426] User defined conversion on return ignores array types

2011-07-14 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41426 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail

[Bug c++/31397] Useful compiler warning missing (virtual functions in derived classes used without 'virtual')

2011-07-09 Thread ville.voutilainen at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31397 Ville Voutilainen changed: What|Removed |Added CC||ville.voutilainen at gmail

<    1   2   3   4   5   6