[Bug c++/61260] Issue with instantiates of variadic templates inside other templates (possibly name lookup problem)

2014-05-20 Thread delong.j at fb dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61260

--- Comment #1 from Jordan DeLong  ---
The original error.cc compiles on clang and icc.


[Bug c++/61260] New: Issue with instantiates of variadic templates inside other templates (possibly name lookup problem)

2014-05-20 Thread delong.j at fb dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61260

Bug ID: 61260
   Summary: Issue with instantiates of variadic templates inside
other templates (possibly name lookup problem)
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: delong.j at fb dot com

Created attachment 32833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32833&action=edit
Example source snippets

Calling a variadic function template that returns an instantiation of a
variadic class template seems to sometimes incorrectly fail to find member
functions of the class.

In the attached, error.cc says:

  error: ‘Hey::str() [with Blah = {const char (&)[7], const char*&};
std::string = std::basic_string]’ is not a member of ‘Hey’

Modifying it to fixed.cc compiles.

If you make the strings the same length in the ternary operator, it also
compiles.  (fixed2.cc.)

Turning the struct "A" into a non-template also leads to it compiling
(fixed3.cc).

[Bug c++/54604] ICE (segv) calling member function template in a lambda

2012-09-17 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54604

--- Comment #2 from Jordan DeLong  2012-09-17 17:35:34 
UTC ---
Thanks!


[Bug c++/54604] New: ICE (segv) calling explicitly member function template specialization in a lambda

2012-09-16 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54604

 Bug #: 54604
   Summary: ICE (segv) calling explicitly member function template
specialization in a lambda
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: delon...@fb.com


Small repro case:

% cat crash.cpp
class C {
public:
  template void f() { }
  template void g() {
auto foo = [&]() { f(); };
  }
};

int main() {
   C c;
   c.g();
}

% g++_4.7 -std=gnu++0x crash.cpp
crash.cpp: In instantiation of ‘C::g() [with bool Fun = false]::’:
crash.cpp:5:18:   required from ‘struct C::g() [with bool Fun =
false]::’
crash.cpp:5:34:   required from ‘void C::g() [with bool Fun = false]’
crash.cpp:11:15:   required from here
crash.cpp:5:24: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


[Bug c++/52851] auto&& fails to deduce type in function template

2012-04-03 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52851

--- Comment #2 from Jordan DeLong  2012-04-03 19:07:21 
UTC ---
In that case it would be a bug that it works outside of a template, no?

But I don't think this is actually supposed to declare an rvalue reference. 
The && on an auto works more like it does in template argument deduction, and
should collapse into an lvalue reference here.  (I'm failing to find
chapter/verse about this at the moment, but if you look at the definition of
range-based for in 6.5.4 it's using auto&& in this way.)


[Bug c++/52851] New: auto&& fails to deduce type in function template

2012-04-03 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52851

 Bug #: 52851
   Summary: auto&& fails to deduce type in function template
Classification: Unclassified
   Product: gcc
   Version: 4.6.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: delon...@fb.com


// Code snippet:

struct C { int var; };

template void func(C* x) {
  // error: invalid initialization of reference of type ‘int&&’ from expression
of type ‘int’
  auto&& foo = x->var;
}

int main() { func(new C); }


[Bug libstdc++/50529] [C++0x] std::vector::erase invokes undefined behavior with empty range

2011-09-26 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50529

--- Comment #5 from Jordan DeLong  2011-09-27 02:56:14 
UTC ---
Nice.  Thanks!


[Bug libstdc++/50529] New: std::vector::erase invokes undefined behavior with empty range

2011-09-26 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50529

 Bug #: 50529
   Summary: std::vector::erase invokes undefined behavior with
empty range
Classification: Unclassified
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: libstdc++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: delon...@fb.com


If you call vector erase() with an empty range, it invokes std::move() with an
output iterator inside of the source range.  (I.e. it tries to move all the
elements onto themselves.)  This causes problems if some of the elements don't
support self move-assignment (e.g. if they are other std::vectors).


[Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr

2011-09-16 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50361

--- Comment #8 from Jordan DeLong  2011-09-16 20:12:43 
UTC ---
Thanks!


[Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr

2011-09-12 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50361

--- Comment #5 from Jordan DeLong  2011-09-12 19:38:22 
UTC ---
Ah, thanks Paolo.  That simplification also gave me enough hints for a
work-around for now.


[Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction

2011-09-11 Thread delong.j at fb dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50361

 Bug #: 50361
   Summary: gcc 4.6 ICE probably relating to std::initializer_list
and template argument deduction
Classification: Unclassified
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: delon...@fb.com


Created attachment 25243
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25243
preprocessed source output

Error is:

gcc_test/test.cpp: In function ‘int main()’:
gcc_test/test.cpp:67: 1: internal compiler error: in fold_convert_loc, at
fold-const.c:2028
Please submit a full bug report,
with preprocessed source if appropriate.

I was running into this in a fairly convoluted case, but pulled parts of it out
until I had a fairly minimal repro.

A hint here appears to be that if you define the constructors inside the class
instead of outside the class the ICE goes away.  Also removing the union member
removes the ICE.