[Bug c++/43790] New: In lambda express, calling member function of non-captured class gives internal compiler error

2010-04-18 Thread darlingm at gmail dot com
The below at the bottom of this comment gives:

/usr/local/bin/g++ -v -save-temps -std=gnu++0x -o
CMakeFiles/gccError.dir/gccError.cpp.o -c
/home/darlingm/code.gccerror/testing/gccError/gccError.cpp

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --disable-multilib --enable-language=c,c++
--disable-nls
Thread model: posix
gcc version 4.6.0 20100418 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++0x' '-o'
'CMakeFiles/gccError.dir/gccError.cpp.o' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/cc1plus -E -quiet -v
-D_GNU_SOURCE /home/mdarling/code.gccerror/testing/gccError/gccError.cpp
-mtune=generic -march=x86-64 -std=gnu++0x -fpch-preprocess -o gccError.ii
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/x86_64-unknown-linux-gnu

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++0x' '-o'
'CMakeFiles/gccError.dir/gccError.cpp.o' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/cc1plus -fpreprocessed
gccError.ii -quiet -dumpbase gccError.cpp -mtune=generic -march=x86-64
-auxbase-strip CMakeFiles/gccError.dir/gccError.cpp.o -std=gnu++0x -version -o
gccError.s
GNU C++ (GCC) version 4.6.0 20100418 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20100418 (experimental), GMP version
4.3.1, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.6.0 20100418 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20100418 (experimental), GMP version
4.3.1, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7af0c1b1da9d8e649a58d85fd58b2bfb
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp: In lambda function:
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp:25:14: error:
'classInstance' is not captured
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp:26:4: internal
compiler error: tree check: expected class 'type', have 'exceptional'
(error_mark) in cv_unqualified, at cp/tree.c:937
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.



The original internal compiler error was of course in a much larger project,
and had a bunch of other code errors on it being the first compile attempt.  I
got tunnel visioned at the first sight of an internal compiler error and spent
hours re-checking out the svn gcc source and recompiling, in case my svn
version from a week ago had a fixed bug in it.

After removing irrelevant portions of the program to get down to a small test
case, it appears that calling a member function of a non-captured class gives
an internal compiler error.  Properly changing the lambda expression line to
"function lambdaExpression = [&classInstance] () {" prevents the
internal compiler error.

I know it's invalid c++0x code that's causing the internal compiler error, but
removing the internal compiler error and only showing the message "error:
'classInstance' is not captured" might save someone else a few hours who gets
tunnel visioned on the one error.  :)


==
#include 
#include 
#include 
using namespace std;

class theClass {
   public:
  theClass();
  string getA();
   private:
  string a;
};

theClass::theClass() 
: a("theData") {
}

string theClass::getA() {
   return a;
}

int main() {
   theClass classInstance;
   function lambdaExpression = [] () {
  return classInstance.getA();
   }; 
   cout << lambdaExpression() << endl;
}


-- 
   Summary: In lambda express, calling member function of non-
        captured class gives internal compiler error
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: darlingm at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43790



[Bug c++/43792] New: In lambda express, calling member function of non-captured class gives internal compiler error

2010-04-19 Thread darlingm at gmail dot com
The below at the bottom of this comment gives:

/usr/local/bin/g++ -v -save-temps -std=gnu++0x -o
CMakeFiles/gccError.dir/gccError.cpp.o -c
/home/darlingm/code.gccerror/testing/gccError/gccError.cpp

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --disable-multilib --enable-language=c,c++
--disable-nls
Thread model: posix
gcc version 4.6.0 20100418 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++0x' '-o'
'CMakeFiles/gccError.dir/gccError.cpp.o' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/cc1plus -E -quiet -v
-D_GNU_SOURCE /home/mdarling/code.gccerror/testing/gccError/gccError.cpp
-mtune=generic -march=x86-64 -std=gnu++0x -fpch-preprocess -o gccError.ii
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/x86_64-unknown-linux-gnu

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=gnu++0x' '-o'
'CMakeFiles/gccError.dir/gccError.cpp.o' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/cc1plus -fpreprocessed
gccError.ii -quiet -dumpbase gccError.cpp -mtune=generic -march=x86-64
-auxbase-strip CMakeFiles/gccError.dir/gccError.cpp.o -std=gnu++0x -version -o
gccError.s
GNU C++ (GCC) version 4.6.0 20100418 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20100418 (experimental), GMP version
4.3.1, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.6.0 20100418 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20100418 (experimental), GMP version
4.3.1, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7af0c1b1da9d8e649a58d85fd58b2bfb
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp: In lambda function:
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp:25:14: error:
'classInstance' is not captured
/home/mdarling/code.gccerror/testing/gccError/gccError.cpp:26:4: internal
compiler error: tree check: expected class 'type', have 'exceptional'
(error_mark) in cv_unqualified, at cp/tree.c:937
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.



The original internal compiler error was of course in a much larger project,
and had a bunch of other code errors on it being the first compile attempt.  I
got tunnel visioned at the first sight of an internal compiler error and spent
hours re-checking out the svn gcc source and recompiling, in case my svn
version from a week ago had a fixed bug in it.

After removing irrelevant portions of the program to get down to a small test
case, it appears that calling a member function of a non-captured class gives
an internal compiler error.  Properly changing the lambda expression line to
"function lambdaExpression = [&classInstance] () {" prevents the
internal compiler error.

I know it's invalid c++0x code that's causing the internal compiler error, but
removing the internal compiler error and only showing the message "error:
'classInstance' is not captured" might save someone else a few hours who gets
tunnel visioned on the one error.  :)


==
#include 
#include 
#include 
using namespace std;

class theClass {
   public:
  theClass();
  string getA();
   private:
  string a;
};

theClass::theClass() 
: a("theData") {
}

string theClass::getA() {
   return a;
}

int main() {
   theClass classInstance;
   function lambdaExpression = [] () {
  return classInstance.getA();
   }; 
   cout << lambdaExpression() << endl;
}


-- 
   Summary: In lambda express, calling member function of non-
        captured class gives internal compiler error
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: darlingm at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43792



[Bug c++/43792] In lambda express, calling member function of non-captured class gives internal compiler error

2010-04-19 Thread darlingm at gmail dot com


--- Comment #1 from darlingm at gmail dot com  2010-04-19 07:23 ---
(bad refresh)

*** This bug has been marked as a duplicate of 43790 ***


-- 

darlingm at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43792



[Bug c++/43790] In lambda express, calling member function of non-captured class gives internal compiler error

2010-04-19 Thread darlingm at gmail dot com


--- Comment #1 from darlingm at gmail dot com  2010-04-19 07:23 ---
*** Bug 43792 has been marked as a duplicate of this bug. ***


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43790



[Bug c++/43790] [C++0x] In lambda express, calling member function of non-captured class gives internal compiler error

2010-04-28 Thread darlingm at gmail dot com


--- Comment #6 from darlingm at gmail dot com  2010-04-28 21:27 ---
Looks good, thanks!

No more internal compiler error, and now nicely says "error: '' is not
captured", where  is of course the name of the uncaptured variable.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43790



[Bug c/65999] New: c11 compliance - fopen_s not supported

2015-05-03 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65999

Bug ID: 65999
   Summary: c11 compliance - fopen_s not supported
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: darlingm at gmail dot com
  Target Milestone: ---

Microsoft implemented fopen_s some time ago.  According to
http://en.cppreference.com/w/c/io/fopen, it was made part of the C11 standard. 
(Forgive me if they're wrong.)

GCC v5.1.0 doesn't seem to support it.  grep fopen_s -r * through its source
finds nothing.  grep'ing through /usr/include (gcc 4.9.2) and
/usr/local/include (gcc 5.1.0) only finds it in
/usr/include/wine/msvcrt/{stdio.h & wchar.h}


[Bug c/66000] New: Suggestion: more than one "not declared in this scope" per line

2015-05-03 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66000

Bug ID: 66000
   Summary: Suggestion: more than one "not declared in this scope"
per line
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: darlingm at gmail dot com
  Target Milestone: ---

With the code
   nonExistantClass varName = nonExistantFunction();

gcc 5.1.0 gives
   error: `nonExistantClass' was not declared in this scope
  nonExistantClass varName = nonExistantFunction();
  ^

It might be better if it ALSO gave:
   error: `nonExistantFunction' was not declared in this scope
  nonExistantClass varName = nonExistantFunction();
 ^


[Bug c++/66231] New: -Werror=zero-as-null-pointer-constant - errors on -isystem function default values of NULL

2015-05-20 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66231

Bug ID: 66231
   Summary: -Werror=zero-as-null-pointer-constant - errors on
-isystem function default values of NULL
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: darlingm at gmail dot com
  Target Milestone: ---

I'm using -Werror=zero-as-null-pointer-constant.

I'm using a library with a header providing default values on some functions of
NULL.

gcc trunk issues an error, since I'm using that default value.

But, I included that library's headers with -isystem.

I get that in one sense NULL is "imported" into my source and used, but I
really think the spirit of -isystem is being violated here.  I either have to
edit library header files which aren't mine, or I can't use
-Werror=zero-as-null-pointer-constant.


[Bug other/66259] New: Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-05-22 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259

Bug ID: 66259
   Summary: Combined gcc and binutils build from git-master fails,
with gas/as-new not existing
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: darlingm at gmail dot com
  Target Milestone: ---

Posted this first at binutils.  Alan Modra said "Not a binutils bug." and
closed it, at https://sourceware.org/bugzilla/show_bug.cgi?id=18450

On a fresh Fedora 21 install:

sudo yum install git gcc gcc-c++ texinfo-tex flex bison mpfr-devel gmp-devel
libmpc-devel isl isl-devel
mkdir gcc.binutils.combined
cd gcc.binutils.combined
git clone git://gcc.gnu.org/git/gcc.git gcc.git
git clone git://sourceware.org/git/binutils-gdb.git binutils-gdb.git
mkdir combined
cd combined
ln -s ../gcc.git/* .
ln --force -s ../binutils-gdb.git/* .
mkdir ../../gcc.binutils.combined.build.gcc
cd ../../gcc.binutils.combined.build.gcc
../gcc.binutils.combined/combined/configure --disable-multilib && make && sudo
make install

Wind up getting:
../gcc.binutils.combined.build.gcc/./prev-gcc/as: line 106:
../gcc.binutils.combined.build.gcc/./gas/as-new: No such file or directory

Line 106 is:
exec $original ${1+"$@"} # with $original coming from case "$original" in

With:
[gcc.binutils.combined.build.gcc]$ find . | grep as-new
./prev-gas/as-new

Should gcc.binutils.combined.build.gcc/./prev-gcc/as:106 be calling
./prev-gas/as-new rather than ./gas/as-new ?


[Bug other/66259] Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-05-22 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259

--- Comment #1 from Michael Darling  ---
BTW, this happens on stage 2.

Uncombined build works just fine...

If I:

mkdir binutils.build.gcc492
cd binutils.build.gcc492
../gcc.binutils.combined/binutils-gdb.git/configure --disable-multilib && make
&& sudo make install
^^ this uses gcc 4.9.2


Or, even if I:

mkdir gcc.build.gcc
cd gcc.build.gcc
../gcc.binutils.combined/gcc.git/configure --disable-multilib && make && sudo
make install
hash -r
// add /usr/local/lib64 to ldconfig, and run ldconfig
mkdir ../binutils.build.gcc6
cd ../binutils.build.gcc6
../gcc.binutils.combined/binutils-gdb.git/configure --disable-multilib && make
&& sudo make install
^^ case uses gcc6
// then I can even
ldconfig
mkdir ../gcc.build.gcc6.with.new.binutils
cd ../gcc.build.gcc6.with.new.binutils
../gcc.binutils.combined/gcc.git/configure --disable-multilib && make && sudo
make install


[Bug other/66259] Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-05-23 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259

--- Comment #4 from Michael Darling  ---
symlinking binutils source first, and overwriting symlinks with gcc source did
not help - same error.

Have to run out for a bit, but I almost have this narrowed down to the exact
commit that caused this.  I'll report back.


[Bug other/66259] Combined gcc and binutils build from git-master fails, with gas/as-new not existing

2015-05-24 Thread darlingm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66259

--- Comment #5 from Michael Darling  ---
The commit that broke combined builds is:
binutils # 35eafcc71b8a54330704656fb6df0b5d6665ed15 Fri Jul 4 12:59:42 2014
+0930 | Rename 

configure.in to configure.ac (HEAD)

If I run binutils # 35eafcc combined with gcc # 09853ca {Jul 4 15:56:27 2014},
I get the same error regarding "gas/as-new not existing".

If I move binutils to its parent, # 82b57a9, combined with the same gcc, it
builds just fine.  (I was using "configure --disable-multilib" and CFLAGS &
CXXFLAGS being "-Wno-error=unused-value -Wno-error=strict-overflow
-Wno-error=maybe-uninitialized".  Not sure if these 3 were all needed for gcc
4.9.2 to "backwards compile" gcc between 4.8.3 and 4.8.4, but I picked these 3
up along the way binary searching for the problem.)

I can move gcc a few ways in either direction with no effect.  It all depends
on which side if this binutils commit it's on.

Binutils # 35eafcc renamed 6 configure.in files to configure.ac (in bfd,
binutils, gas, gprof, ld, and opcodes).  It updated binutils calls to these
files with the new extension.  But, there was never a corresponding change to
gcc to use the new extension.  And, it left 3 configure.in files with th eold
extension (in etc, readline, and readline/examples/rlfe).

Fixing the gcc calls to binutils configure files is much easier with all of
binutils configure.in files renamed to configure.ac.  So, I submitted a patch
to binutils to rename the 3 remaining configure.in files, and update all
references to them within binutils.  And, I submitted a patch to gcc to fix all
references to binutils configure.in files to the new extension.

I also noticed gcc renamed its configure.in files to configure.ac some time
ago.  But, a few references to configure.in remained in error messages and
documentation.  The gcc patch I submitted fixes these references.