[Bug c++/48196] New: ICE (segmentation fault) on inclusion of , C++0x

2011-03-18 Thread gcchelp.5.adept at 0sg dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48196

   Summary: ICE (segmentation fault) on inclusion of ,
C++0x
   Product: gcc
   Version: 4.5.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: gcchelp.5.ad...@0sg.net


Created attachment 23715
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23715
preprocessed source, exhibiting the bug

I will attach two preprocessed files, one for which GCC is working, and one for
which GCC stops with an ICE. The difference is in the inclusion of  at
one point.

I am using GCC 4.5.2 on mac, compiled from FSF source as follows

Using built-in specs.
COLLECT_GCC=/opt/bin/gcc
COLLECT_LTO_WRAPPER=/opt/gcc-4.5/bin/../libexec/gcc/x86_64-apple-darwin10.6.0/4.5.2/lto-wrapper
Target: x86_64-apple-darwin10.6.0
Configured with: ../gcc-4.5.2/configure -prefix=/opt/gcc --with-gmp=/opt/gmp
--with-mpfr=/opt/mpfr --with-mpc=/opt/mpc --with-ppl=/opt/ppl
--with-cloog=/opt/cloog --disable-nls --enable-visibility --with-arch=nocona
Thread model: posix
gcc version 4.5.2 (GCC) 

The command line option used to produce the bug:

/opt/bin/gcc -x c++ -m32 -fmessage-length=0 -pipe -std=gnu++0x -Wno-trigraphs
-fno-exceptions -fno-rtti -O0 -D_DEBUG=1 -isysroot
/Developer/SDKs/MacOSX10.5.sdk -mfix-and-continue -ffast-math
-Wno-invalid-offsetof -mmacosx-version-min=10.5 -gdwarf-2
-F/Users/christian/Desktop/depot/dev/build/../bin
-I/Users/christian/Desktop/depot/dev/build/../bin/include
-I/Users/christian/Desktop/depot/dev/build/../00-temp/mbl.build/Debug/arieslib-level0.build/DerivedSources/i386
-I/Users/christian/Desktop/depot/dev/build/../00-temp/mbl.build/Debug/arieslib-level0.build/DerivedSources
-Wall -fvisibility=hidden -c
/Users/christian/Desktop/depot/dev/build/../source/arieslib/script-compiler-codegen.cc
-o
/Users/christian/Desktop/depot/dev/build/../00-temp/mbl.build/Debug/arieslib-level0.build/Objects-normal/i386/script-compiler-codegen.o

When the ICE occurs, the output is

In file included from
/Users/christian/Desktop/depot/dev/build/../source/arieslib/core-table.h:29:0,
 from
/Users/christian/Desktop/depot/dev/build/../source/arieslib/script-parser.h:11,
 from
/Users/christian/Desktop/depot/dev/build/../source/arieslib/script-compiler.h:11,
 from
/Users/christian/Desktop/depot/dev/build/../source/arieslib/script-compiler-codegen.cc:11:
/Users/christian/Desktop/depot/dev/build/../source/arieslib/core-array.h: In
member function 'void Array::InsertSpace(unsigned int, unsigned
int)':
/Users/christian/Desktop/depot/dev/build/../source/arieslib/core-array.h:716:34:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Thanks!


[Bug c++/48196] ICE (segmentation fault) on inclusion of , C++0x

2011-03-18 Thread gcchelp.5.adept at 0sg dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48196

--- Comment #1 from gcchelp.5.adept at 0sg dot net 2011-03-18 19:35:45 UTC ---
Created attachment 23716
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23716
does not exhibit the bug


[Bug driver/48208] New: -F option is not joined

2011-03-19 Thread gcchelp.5.adept at 0sg dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48208

   Summary: -F option is not joined
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: gcchelp.5.ad...@0sg.net


The darwin linker complains that the argument to the -F option is not joined.
There seems to be code in the driver to do just this (gcc.c)

case OPT_F:
  /* Likewise -F.  */
  save_switch (concat ("-F", arg, NULL), 0, NULL, validated);
  return true;

but this can never be called since the -F option does not have CL_DRIVER flag
(c.opt)

F
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
-F Add  to the end of the main framework include path

please change it to

F
Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after
%qs)
-F Add  to the end of the main framework include path


[Bug c++/48196] [C++0x] ICE on inclusion of , decltype

2011-03-22 Thread gcchelp.5.adept at 0sg dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48196

Christian Schüler  changed:

   What|Removed |Added

Summary|ICE (segmentation fault) on |[C++0x] ICE on inclusion of
   |inclusion of , |, decltype
   |C++0x   |

--- Comment #2 from Christian Schüler  
2011-03-23 02:24:19 UTC ---
It also does not exhibit the bug when 'decltype' is replaced with '__typeof'.
This can be done as a workaround.


[Bug c++/48196] [C++0x] ICE on inclusion of , decltype

2011-03-23 Thread gcchelp.5.adept at 0sg dot net

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

--- Comment #5 from Christian Schüler  
2011-03-23 20:00:55 UTC ---
Yes, 4.6. release candidate doesn't crash thanks


[Bug driver/48260] New: Accept -arch as an alias for -m32/-m64 on darwin

2011-03-23 Thread gcchelp.5.adept at 0sg dot net

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

   Summary: Accept -arch as an alias for -m32/-m64 on darwin
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: gcchelp.5.ad...@0sg.net


If the GCC driver is supplied with '-arch i386' when invoked as linker on
intel-darwin, this should have the same effect as '-m32' (effectively an
alias). Conversely, if '-arch x86_64' is supplied, it should have the same
effect as '-m64'. No further support for the '-arch' switch is necessary.
Without this support, it is impossible to configure the latest GCC to be used
from within xcode. As a proof of concept, I have a patch working that achieves
this.

diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/c-family/c.opt
gcc-4.6.0-RC-20110314-patched/gcc/c-family/c.opt
204c204
< C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
---
> Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after 
> %qs)
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/config/darwin.opt
gcc-4.6.0-RC-20110314-patched/gcc/config/darwin.opt
33a34,36
> arch
> Driver RejectNegative Separate 
> 
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/config/i386/darwin.h
gcc-4.6.0-RC-20110314-patched/gcc/config/i386/darwin.h
120c120
< #define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}"
---
> #define DARWIN_ARCH_SPEC "%{m64:x86_64;arch*:%*;:i386}"
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/config/i386/darwin64.h
gcc-4.6.0-RC-20110314-patched/gcc/config/i386/darwin64.h
25c25
< #define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}"
---
> #define DARWIN_ARCH_SPEC "%{m32:i386;arch*:%*;:x86_64}"
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/config/i386/t-darwin
gcc-4.6.0-RC-20110314-patched/gcc/config/i386/t-darwin
2a3
> MULTILIB_MATCHES = "m64=arch+x86_64" 
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/config/i386/t-darwin64
gcc-4.6.0-RC-20110314-patched/gcc/config/i386/t-darwin64
5a6
> MULTILIB_MATCHES = "m32=arch+i386" 
diff --recursive --normal -w gcc-4.6.0-RC-20110314/gcc/gcc.c
gcc-4.6.0-RC-20110314-patched/gcc/gcc.c
7106a7107
> const char *arg;
7108a7110
> int arg_len;
7135c7137
<   while (*q != ' ')
---
> while (*q != ' ' && *q != '+')
7146a7149,7162
> if (*q == '+')
>   {
> matches[i].arg = ++q;
> while (*q != ' ')
> {
>   if (*q == '\0')
> goto invalid_matches;
>   q++;
> }
> matches[i].arg_len = q - matches[i].arg;
>   } 
> else
>   matches[i].arg_len = 0;
> 
7172c7188,7189
<   && ! strncmp (switches[i].part1, matches[j].str, xlen))
---
> && ! strncmp (switches[i].part1, matches[j].str, xlen)
> && ( !matches[j].arg_len || ( switches[i].args && !strncmp 
> (switches[i].args[0], matches[j].arg, matches[j].arg_len ) ) ) )


[Bug c++/99610] New: GCC thinks member function template is a deduction guide

2021-03-15 Thread gcchelp.5.adept at 0sg dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99610

Bug ID: 99610
   Summary: GCC thinks member function template is a deduction
guide
   Product: gcc
   Version: 8.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcchelp.5.adept at 0sg dot net
  Target Milestone: ---

When compiling with -std=c++17 or -std=gnu++17,
the following errors are reported for the code below:

[2] error: return type specified for deduction guide
[2] error: decl-specifier in declaration of deduction guide
[2] error: 'signed' or 'unsigned' invalid for '__dguide_Hash'
[2] error: deduction guide for 'Hash' must have trailing return type
[1] note: 'template class Hash' declared here

The same code is accepted without errors by clang and msvc 2019.
I'm not sufficiently versed in the c++ standard to tell if this is on the
compiler or not.

Thanks!


-- 

[1] template< typename K, typename V, typename C = HashContext >
class Hash 
{
// ...
};


template< typename K >
class HashContext
{
public:
template< typename X >
[2] unsigned Hash( const X &arg ) const
{ ... }
};

[Bug c++/99610] GCC thinks member function template is a deduction guide

2021-03-15 Thread gcchelp.5.adept at 0sg dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99610

--- Comment #1 from Christian Schüler  ---
There is a workaround
declaring the function Hash with trailing return will make the error go away.

template< typename X >
auto Hash( const X &arg ) const -> unsigned
 { ... }

[Bug c++/99610] GCC thinks member function template is a deduction guide

2021-03-15 Thread gcchelp.5.adept at 0sg dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99610

--- Comment #2 from Christian Schüler  ---
gcc version 8.4.0 (Ubuntu 8.4.0-1ubuntu1~18.04)