[Bug c++/52659] New: GCC fails to reject a deleted function definition which is not the first declaration

2012-03-21 Thread illissius at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52659

 Bug #: 52659
   Summary: GCC fails to reject a deleted function definition
which is not the first declaration
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: illiss...@gmail.com


C++11 8.4.3.4:
"A deleted definition of a function shall be the first declaration of the
function or, for an explicit specialization of a function template, the first
declaration of that specialization. [ Example:
struct sometype {
  sometype();
};
sometype::sometype() = delete; // ill-formed; not first declaration
— end example ]"


$ cat bug.cpp
struct sometype {
  sometype();
};

sometype::sometype() = delete;

$ g++ bug.cpp -std=c++11 -c
$ g++ --version
g++ (GCC) 4.7.0 20120314 (prerelease)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


[Bug c++/51239] New: ICE with variadic template alias

2011-11-20 Thread illissius at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

 Bug #: 51239
   Summary: ICE with variadic template alias
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: illiss...@gmail.com


The following code (self-contained):

template
using head = T;

template
using x = head;

results for me in the following error:

$ LD_LIBRARY_PATH=/opt/gcc4.7/lib:$LD_LIBRARY_PATH PATH=/opt/gcc4.7/bin/:$PATH
g++ -std=c++11 test68.cpp 
test68.cpp:2:15: internal compiler error: tree check: accessed elt 2 of
tree_vec with 1 elts in tsubst_pack_expansion, at cp/pt.c:9298
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

GCC version:

$ LD_LIBRARY_PATH=/opt/gcc4.7/lib:$LD_LIBRARY_PATH PATH=/opt/gcc4.7/bin/:$PATH
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/gcc4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../trunk/configure --disable-bootstrap
--enable-languages=c,c++ --prefix=/opt/gcc4.7
Thread model: posix
gcc version 4.7.0 2020 (experimental) (GCC)

SVN revision: 181530

A version from 2009 produced the same error (at a different line number).

The line in question in the current revision, and the two lines before it:
  levels = TMPL_ARGS_DEPTH (args);
  if (level <= levels)
arg_pack = TMPL_ARG (args, level, idx);