[Bug c++/53586] Internal compiler errors on cp/pt.c:12077 and expr.c:9147

2013-08-09 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53586

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Known to work||4.8.1, 4.9.0
 Resolution|--- |FIXED

--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com ---
No ICEs with current mainline and 4_8-branch.


[Bug c++/53586] Internal compiler errors on cp/pt.c:12077 and expr.c:9147

2012-06-06 Thread paulotorrens at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53586

--- Comment #2 from Paulo Torrens paulotorrens at gnu dot org 2012-06-06 
18:43:13 UTC ---
(In reply to comment #1)
 What happens if you use decltype instead of typeof ?



templatetypename T auto ptr2bitmap(T *bitmap, int width, int depth = 3) -
decltype(decltype(unsigned char[depth])[width]) *{
  return bitmap;
};

int main() {
  void *x;
  auto a = ptr2bitmap(x, 100);
};


test.cpp:2:10: error: expected primary-expression before 'decltype'
test.cpp:2:10: error: expected ')' before 'decltype'
test.cpp:2:1: error: expected type-specifier before 'decltype'
test.cpp:2:1: error: expected initializer before 'decltype'







And without decltype and typeof at all:


templatetypename T auto ptr2bitmap(T *bitmap, int width, int depth = 3) -
unsigned char[depth][width] *{
  return bitmap;
};

int main() {
  void *x;
  auto a = ptr2bitmap(x, 100);
};




test.cpp:2:15: error: use of parameter 'depth' outside function body
test.cpp:2:22: error: use of parameter 'width' outside function body
test.cpp:2:29: error: expected initializer before '*' token


[Bug c++/53586] Internal compiler errors on cp/pt.c:12077 and expr.c:9147

2012-06-05 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53586

--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org 2012-06-06 
05:58:39 UTC ---
What happens if you use decltype instead of typeof ?