Bug 57 (C++DR325) - [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument
Summary: [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a ...
Status: SUSPENDED
Alias: C++DR325
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: patch, rejects-valid
: 10111 12531 15201 15217 15980 18688 21084 24690 27038 29084 30069 30344 33754 39426 39948 42473 (view as bug list)
Depends on: P1787R6
Blocks: c++-core-issues 52595
  Show dependency treegraph
 
Reported: 2000-03-05 03:26 UTC by martin
Modified: 2024-10-01 21:35 UTC (History)
31 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-10-24 15:46:18


Attachments
proposal patch (930 bytes, patch)
2005-04-06 12:22 UTC, Liu Guanwei
Details | Diff
proposal patch (930 bytes, patch)
2005-04-06 12:27 UTC, Liu Guanwei
Details | Diff
updated patch (1.49 KB, patch)
2007-10-24 19:48 UTC, Jason Merrill
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2000-03-05 03:26:01 UTC
 Original-Message-ID: <384DD807.8721FBCC@roguewave.com>
 Date: Tue, 07 Dec 1999 21:01:11 -0700

 This is a report of a g++ 2.95.2 bug. The code below doesn't compile:

 Thank you
 Martin


 $ cat test.cpp


 template <class T, class U>
 struct A {
     static const int n = 0;
 };

 template <class T>
 struct B
 {
     template <class U>
     void foo (int = A<T, U>::n) { }
 };


 $ g++ -c -v /build/sebor/dev/stdlib2/tests/regress/src/test.cpp
 Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
 gcc version 2.95.2 19991024 (release)
  /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2
 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix
 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix
 -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386)
 -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__
 -D__pentiumpro -D__pentiumpro__
 /build/sebor/dev/stdlib2/tests/regress/src/test.cpp /tmp/ccsxupTb.ii
 GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
  /usr/local/include

 /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
  /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
  /usr/include
 End of search list.
 The following default directories have been omitted from the search
 path:
 End of omitted list.
  /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccsxupTb.ii
 -quiet -dumpbase test.cc -version -o /tmp/cceGXWld.s
 GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled
 by GNU C version 2.95.2 19991024 (release).
 /build/sebor/dev/stdlib2/tests/regress/src/test.cpp:12: parse error
 before `>'


 ==============================================
     Martin Sebor, Lead Software Engineer
 C++ Standards Group, Rogue Wave Software, Inc.
     sebor@roguewave.com   (303) 545-3287

Release:
2.95.2
Comment 1 Martin v. Loewis 2000-03-08 23:39:15 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed as a bug
Comment 2 Martin v. Loewis 2000-03-09 07:39:15 UTC
From: loewis@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de,
  nobody@gcc.gnu.org, sebor@roguewave.com
Cc:  
Subject: Re: c++/57
Date: 9 Mar 2000 07:39:15 -0000

 Old Synopsis: [not accepted] templates in default arguments
 New Synopsis: templates in default arguments
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: loewis
 State-Changed-When: Wed Mar  8 23:39:15 2000
 State-Changed-Why:
     Confirmed as a bug  
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=57&database=gcc

Comment 3 Wolfgang Bangerth 2002-10-22 18:47:32 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: nathan@codesourcery.com, <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/57: [parser] templates in default arguments
Date: Tue, 22 Oct 2002 18:47:32 -0500 (CDT)

 Nathan,
 the following code has, if I recall correctly, invalid syntax:
 ---------------------------------------------
 template <class T, class U>
 struct A {
      static const int n = 0;
 };
 
 template <class T>
 struct B
 {
      template <class U>
      void foo (int = A<T, U>::n) { }
 };
 ---------------------------------------------
 In the default argument parsing, there's a "," not nested inside 
 parentheses. This stops default argument parsing. If you agree, then this 
 report should be closed.
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 
 
 
 

Comment 4 Wolfgang Bangerth 2002-10-23 20:10:32 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: nathan@codesourcery.com, <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/57: [parser] templates in default arguments
Date: Wed, 23 Oct 2002 20:10:32 -0500 (CDT)

 > >      void foo (int = A<T, U>::n) { }
 > > ---------------------------------------------
 > > In the default argument parsing, there's a "," not nested inside 
 > > parentheses. This stops default argument parsing. If you agree, then this 
 > > report should be closed.
 > 
 > FWIW Comeau accepts it in strict conforming mode.
 
 I think I recall there was a defect report about this, but I can't seem to
 find it anymore, and I also don't recall whether it was resolved either
 way or other ...
 
 Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 

Comment 5 Neil Booth 2002-10-23 20:31:03 UTC
From: Neil Booth <neil@daikokuya.co.uk>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: nathan@codesourcery.com, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/57: [parser] templates in default arguments
Date: Wed, 23 Oct 2002 20:31:03 +0100

 Wolfgang Bangerth wrote:-
 
 > 
 > Nathan,
 > the following code has, if I recall correctly, invalid syntax:
 > ---------------------------------------------
 > template <class T, class U>
 > struct A {
 >      static const int n = 0;
 > };
 > 
 > template <class T>
 > struct B
 > {
 >      template <class U>
 >      void foo (int = A<T, U>::n) { }
 > };
 > ---------------------------------------------
 > In the default argument parsing, there's a "," not nested inside 
 > parentheses. This stops default argument parsing. If you agree, then this 
 > report should be closed.
 
 FWIW Comeau accepts it in strict conforming mode.
 
 Neil.

Comment 6 Nathan Sidwell 2002-10-24 08:48:36 UTC
From: Nathan Sidwell <nathan@codesourcery.com>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: Neil Booth <neil@daikokuya.co.uk>, gcc-bugs@gcc.gnu.org,
   gcc-gnats@gcc.gnu.org
Subject: Re: c++/57: [parser] templates in default arguments
Date: Thu, 24 Oct 2002 08:48:36 +0100

 Wolfgang Bangerth wrote:
 >>>     void foo (int = A<T, U>::n) { }
 >>>---------------------------------------------
 >>>In the default argument parsing, there's a "," not nested inside 
 >>>parentheses. This stops default argument parsing. If you agree, then this 
 >>>report should be closed.
 >>
 >>FWIW Comeau accepts it in strict conforming mode.
 > 
 > 
 > I think I recall there was a defect report about this, but I can't seem to
 > find it anymore, and I also don't recall whether it was resolved either
 > way or other ...
 325. http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#325
 I'm surprised comeau accepts your example, Neil, because I experimented
 with the EDG frontend too.
 
 nathan
 
 -- 
 Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
           'But that's a lie.' - 'Yes it is. What's your point?'
 nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
 
 

Comment 7 Neil Booth 2002-10-24 20:43:41 UTC
From: Neil Booth <neil@daikokuya.co.uk>
To: Nathan Sidwell <nathan@codesourcery.com>
Cc: Wolfgang Bangerth <bangerth@ticam.utexas.edu>, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Subject: Re: c++/57: [parser] templates in default arguments
Date: Thu, 24 Oct 2002 20:43:41 +0100

 Nathan Sidwell wrote:-
 
 > >I think I recall there was a defect report about this, but I can't seem to
 > >find it anymore, and I also don't recall whether it was resolved either
 > >way or other ...
 > 325. http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#325
 > I'm surprised comeau accepts your example, Neil, because I experimented
 > with the EDG frontend too.
 
 I just used their on-line compiler.  The only compiler I "own" is GCC
 8-)
 
 Neil.
Comment 8 Wolfgang Bangerth 2002-11-10 10:56:16 UTC
State-Changed-From-To: analyzed->suspended
State-Changed-Why: Let's put this into suspended state, and wait for the new
    parser and the resolution of the DR.
Comment 9 Nathanael C. Nerode 2003-05-22 15:46:06 UTC
Note that the new parser is here; this is waiting for the DR resolution.
Comment 10 Kriang Lerdsuwanakij 2003-10-18 16:55:01 UTC
*** Bug 12531 has been marked as a duplicate of this bug. ***
Comment 11 Wolfgang Bangerth 2004-04-29 14:22:49 UTC
*** Bug 15201 has been marked as a duplicate of this bug. ***
Comment 12 Andrew Pinski 2004-04-30 01:08:44 UTC
*** Bug 15217 has been marked as a duplicate of this bug. ***
Comment 13 Ivan Godard 2004-04-30 01:47:04 UTC
There is at least one case where this construct is used in the standard (at least in the oldish references I have access to). In <bitset> there is (in the gcc 3.4 include files) the following function:
    template<class _CharT, class _Traits, class _Alloc>
      bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
         size_t __pos, size_t __n) : _Base()
However, according to the SGI documentation this should be:
template<class Char, class Traits, class Alloc>
explicit
bitset(const basic_string<Char,Traits,Alloc>& s,
       size_t pos = 0,
       size_t n = 
         basic_string<Char,Traits,Alloc>::npos)
which is also what C++PL 3rd Edition shows. The initializer "npos" causes gcc to fail with this bug.

FWIW
Comment 14 Wolfgang Bangerth 2004-04-30 14:01:57 UTC
Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument


How funny, the reference is indeed in the standard, it's the last declaration 
on page 502, section 23.3.5.1. Maybe someone can see if there is a defect 
report, though I can't seem to find one if it exists.

It's easy to work around, though, by just duplicating the constructor, and 
having one take the third argument and one not taking it.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/

Comment 15 llewelly 2004-04-30 16:36:01 UTC
Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument

"bangerth at ices dot utexas dot edu" <gcc-bugzilla@gcc.gnu.org> writes:

> ------- Additional Comments From bangerth at ices dot utexas dot edu  2004-04-30 14:01 -------
> Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument
> 
> 
> How funny, the reference is indeed in the standard, it's the last declaration 
> on page 502, section 23.3.5.1. Maybe someone can see if there is a defect 
> report, though I can't seem to find one if it exists.
> 
> It's easy to work around, though, by just duplicating the constructor, and 
> having one take the third argument and one not taking it.
[snip]

The default argument expression can also be parenthesized:

template<class charT, class traits, class Allocator>
explicit
bitset(const basic_string<charT, traits, Allocator>& str,
  typename basic_string<charT, traits, Allocator>::size_type pos =0,
  typename basic_string<charT, traits, Allocator>::size_type n =
  (basic_string<charT, traits, Allocator>::npos));
  ^-extra parentheses--------------------------^

which is perhaps easier.

Comment 16 Martin Sebor 2004-04-30 17:01:27 UTC
(In reply to comment #14)
> Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a
template-id within a default argument
> 
> 
> How funny, the reference is indeed in the standard, it's the last declaration 
> on page 502, section 23.3.5.1.

Sure. That's what the test case was reduced from -- the declaration of the
bitset template ctor :) Has there been any progress on the resolution to issue
325? If the CWG is leaning toward the suggested resolution we might want to file
a library issue to have the bitset ctor declaration changed.

Martin
Comment 17 Ivan Godard 2004-04-30 19:55:21 UTC
Bangaerth suggested a workaround by duplicating the constructor, one with and one without the argument. But there's an even easier workaround: somply parenthesize the default value. I'd suggest that gcc should do this - although the lexical text of the default is not the same as in the standard, this solutiion preserves the actual default values required by the standard and compiles without error.

Ivan
Comment 18 Andrew Pinski 2004-06-13 22:55:20 UTC
*** Bug 15980 has been marked as a duplicate of this bug. ***
Comment 19 Ben Elliston 2004-06-22 02:15:46 UTC
I'm not sure why this PR was suspended.  The problem persists in the new C++ 
parser.  Should the bug be re-opened? 
 
Comment 20 Andrew Pinski 2004-06-22 02:54:40 UTC
The reason why this is still supsended as it is waiting on the DR report to be resolved.
Comment 21 Andrew Pinski 2004-11-27 15:10:52 UTC
*** Bug 18688 has been marked as a duplicate of this bug. ***
Comment 22 Preston A. Elder 2004-11-27 16:04:22 UTC
(In reply to comment #21)
> *** Bug 18688 has been marked as a duplicate of this bug. ***

Is it really a dupe?  The bug I raised only involved a templated argument, the
class with the member function is not templated.  Besides which, if its invalid
as a member function, why is it not invalid stand-alone?  And why should
typedef's get around it?
Comment 23 Nathan Sidwell 2004-11-29 09:26:12 UTC
(In reply to comment #22)
> (In reply to comment #21)
> > *** Bug 18688 has been marked as a duplicate of this bug. ***
> 
> Is it really a dupe?
yes.

>  The bug I raised only involved a templated argument, the
> class with the member function is not templated.
yes

>  Besides which, if its invalid
> as a member function, why is it not invalid stand-alone?
because non-member's default args can be parsed immediately, member's
default args cannot be.

>  And why should typedef's get around it?
because those do not have commas in them

read DR325 for gory details
Comment 24 Liu Guanwei 2005-04-06 12:22:34 UTC
Created attachment 8545 [details]
proposal patch

Modified the function cp_parser_parameter_declaration() in gcc/cp/parser.c.
If the parser encounters a ',', it then tentatively starts parsing another
parameter. If failed, it considers the ',' is within a template parameter.
Comment 25 Liu Guanwei 2005-04-06 12:27:08 UTC
Created attachment 8546 [details]
proposal patch

Modified the function cp_parser_parameter_declaration() in gcc/cp/parser.c.
If the parser encounters a ',', it then tentatively starts parsing another
parameter. If failed, it considers the ',' is within a template parameter.
Comment 26 Liu Guanwei 2005-04-06 14:10:41 UTC
Comment on attachment 8546 [details]
proposal patch

gcc v3.4.3:
gcc/parser.c
Comment 27 Andrew Pinski 2005-04-06 15:18:45 UTC
(In reply to comment #26)
> (From update of attachment 8546 [details])
> gcc v3.4.3:
> gcc/parser.c

I should note this bug is suspended.  This is because the standard is unclear at what is the correct 
behavior.  See DR 325 for all the details.
Comment 28 Andrew Pinski 2005-04-18 18:42:13 UTC
*** Bug 21084 has been marked as a duplicate of this bug. ***
Comment 29 Andrew Pinski 2005-11-06 04:37:55 UTC
*** Bug 24690 has been marked as a duplicate of this bug. ***
Comment 30 Andrew Pinski 2006-04-05 01:57:20 UTC
*** Bug 27038 has been marked as a duplicate of this bug. ***
Comment 31 Andrew Pinski 2006-09-14 15:00:21 UTC
*** Bug 29084 has been marked as a duplicate of this bug. ***
Comment 32 Andrew Pinski 2006-12-04 22:51:30 UTC
*** Bug 30069 has been marked as a duplicate of this bug. ***
Comment 33 Andrew Pinski 2007-01-01 19:02:21 UTC
*** Bug 30344 has been marked as a duplicate of this bug. ***
Comment 34 Paolo Carlini 2007-10-12 18:31:06 UTC
*** Bug 33754 has been marked as a duplicate of this bug. ***
Comment 35 Jason Merrill 2007-10-24 19:48:33 UTC
Created attachment 14407 [details]
updated patch

Here's a cleaned up version of Liu Guanwei's patch that passes regression testing with current 4.3 sources.  I've pinged him for a copyright assignment so I can check it in.
Comment 36 Jason Merrill 2008-04-28 20:44:20 UTC
Subject: Bug 57

Author: jason
Date: Mon Apr 28 20:43:27 2008
New Revision: 134762

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134762
Log:
        PR c++/57
        * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
        in default arguments.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C

Comment 37 Manuel López-Ibáñez 2008-08-10 16:02:19 UTC
I thinks this is fixed and should be closed.
Comment 38 pinskia@gmail.com 2008-08-10 18:22:05 UTC
Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument



Sent from my iPhone

On Aug 10, 2008, at 9:02, "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> ------- Comment #37 from manu at gcc dot gnu dot org  2008-08-10  
> 16:02 -------
> I thinks this is fixed and should be closed.

It is fixed but the defect report against the C++ standard is still  
open so ...
-- Pinski

>
>
>
> -- 
>
> manu at gcc dot gnu dot org changed:
>
>           What    |Removed                     |Added
> --- 
> --- 
> ----------------------------------------------------------------------
>                 CC|                            |manu at gcc dot gnu  
> dot org
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
Comment 39 Manuel López-Ibáñez 2008-08-10 18:31:09 UTC
So then it should be SUSPENDED until the DR is solved.
Comment 40 Sergey Miryanov 2009-01-06 06:03:36 UTC
(In reply to comment #38)
> Subject: Re:  [DR 325] GCC can't parse a non-parenthesized comma in a
> template-id within a default argument
> 
> It is fixed but the defect report against the C++ standard is still  
> open so ...
> -- Pinski
> 

Hello.

First, I'm new in gcc.
I'm moving our project on gcc and I meet this bug.

My code:
template <typename T, bool F>
struct sp
{
  sp ()
  {
  }
};

struct X
{
  typedef sp <X, true> sp_x;
  //X (sp_x x = sp_x ())                      // OK
  //X (sp <X, true> x = (sp <X, true> ()))    // OK
  X (sp <X, true> x = sp <X, true> ())        // ERROR
  {
  }
};

My gcc output:
g++ -o /home/zerg/bs/plugins/test.o -c -v -save-temps /home/zerg/bs/plugins/test.cpp
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) 
COLLECT_GCC_OPTIONS='-o' '/home/zerg/bs/plugins/test.o' '-c' '-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /usr/libexec/gcc/i386-redhat-linux/4.3.2/cc1plus -E -quiet -v -D_GNU_SOURCE /home/zerg/bs/plugins/test.cpp -mtune=generic -fpch-preprocess -o test.ii
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.3.2/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2
 /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/i386-redhat-linux
 /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/backward
 /usr/local/include
 /usr/lib/gcc/i386-redhat-linux/4.3.2/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-o' '/home/zerg/bs/plugins/test.o' '-c' '-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /usr/libexec/gcc/i386-redhat-linux/4.3.2/cc1plus -fpreprocessed test.ii -quiet -dumpbase test.cpp -mtune=generic -auxbase-strip /home/zerg/bs/plugins/test.o -version -o test.s
GNU C++ (GCC) version 4.3.2 20081105 (Red Hat 4.3.2-7) (i386-redhat-linux)
	compiled by GNU C version 4.3.2 20081105 (Red Hat 4.3.2-7), GMP version 4.2.2, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a43cbcaee4cf8f26ffea6bb0c2e68739
/home/zerg/bs/plugins/test.cpp:23: error: expected identifier before 'true'
/home/zerg/bs/plugins/test.cpp:23: error: expected ',' or '...' before 'true'
/home/zerg/bs/plugins/test.cpp:23: error: wrong number of template arguments (1, should be 2)
/home/zerg/bs/plugins/test.cpp:4: error: provided for 'template<class T, bool F> struct sp'
/home/zerg/bs/plugins/test.cpp:23: error: default argument missing for parameter 2 of 'X::X(sp<X, true>, int)'


I read all comments and saw a patch. But I don't know how I can fix my gcc with this patch.
Comment 41 Wolfgang Bangerth 2009-01-06 15:46:41 UTC
(In reply to comment #40)
> I read all comments and saw a patch. But I don't know how I can fix my gcc with
> this patch.

The easiest way is to wait for gcc 4.4.
W.

Comment 42 Andrew Pinski 2009-03-10 23:01:15 UTC
*** Bug 39426 has been marked as a duplicate of this bug. ***
Comment 43 Andrew Pinski 2009-04-28 16:51:54 UTC
*** Bug 39948 has been marked as a duplicate of this bug. ***
Comment 44 keith.g.erickson 2009-09-01 22:11:30 UTC
(In reply to comment #41)
> (In reply to comment #40)
> > I read all comments and saw a patch. But I don't know how I can fix my gcc with
> > this patch.
> 
> The easiest way is to wait for gcc 4.4.
> W.
> 

GCC 4.4 came and went.  Now what?
Comment 45 Paolo Carlini 2009-09-01 22:26:20 UTC
(In reply to comment #44)
> GCC 4.4 came and went.  Now what?

Now what what? The issue is fixed for 4.4, and I just double checked myself the original testcase and the one in Comment #40, both compile fine. Comments #38 and #39 explain why technically the PR must remain suspended for now. So?

Comment 46 Lee Tseng 2009-12-23 07:09:05 UTC
*** Bug 42473 has been marked as a duplicate of this bug. ***
Comment 47 Eric Gallager 2021-07-25 02:53:31 UTC
(In reply to Paolo Carlini from comment #45)
> (In reply to comment #44)
> > GCC 4.4 came and went.  Now what?
> 
> Now what what? The issue is fixed for 4.4, and I just double checked myself
> the original testcase and the one in Comment #40, both compile fine.
> Comments #38 and #39 explain why technically the PR must remain suspended
> for now. So?

Yeah, can this be closed?
Comment 48 Jonathan Wakely 2021-07-26 09:19:22 UTC
No, as previously stated, it's suspended until the Core issue is resolved and the standard is changed.

https://wg21.link/cwg325
Comment 49 Andrew Pinski 2021-12-04 11:49:34 UTC
(In reply to Jonathan Wakely from comment #48)
> No, as previously stated, it's suspended until the Core issue is resolved
> and the standard is changed.
> 
> https://wg21.link/cwg325


Some news on that front too:
Additional note (November, 2020):

Paper P1787R6, adopted at the November, 2020 meeting, partially addresses this issue.