This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9836: [3.4 regression] Error with typdefs in partial specializations of classes


>Number:         9836
>Category:       c++
>Synopsis:       [3.4 regression] Error with typdefs in partial specializations of classes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 17:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
present mainline
>Description:
This broke with a patch that I think must have gone in 
yesterday (2003-02-23):
--------------------------
template <bool, int> struct X {};

template <bool C>    struct X<C,1> {
    typedef double* type;
    type foo () const;
};

template <bool C>
typename X<C,1>::type
X<C,1>::foo () const {}
-------------------------------

deal.II/base> /ticam/bangerth/tmp/build-gcc/gcc-install/bin/gcc -c y.cc
y.cc:10: error: prototype for `typename X<C, 1>::type X<C, 1>::foo() const'
   does not match any in class `X<C, 1>'
y.cc:5: error: candidate is: double* X<C, 1>::foo() const
y.cc:10: error: template definition of non-template `typename X<C, 1>::type
   X<C, 1>::foo() const'

There is only one patch in this timeframe,
2003-02-23  Mark Mitchell  <mark at codesourcery dot com>

	PR c++/5333
	* cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro.
	* parser.c (cp_parser_diagnose_invalid_type_name): Use it.
	* pt.c (instantiate_class_template): Don't try to instantiate
	dependent types.
	(resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.

I'll try to investigate further whether this is the one
that caused the problem, but that will have to wait until
tomorrow, of so. 

Mark, if you spot right away that your patch caused this,
drop me a note so that I can short-cut my efforts on this.

W.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]