public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17413] New: diagnostic regression for local classes as template argument
@ 2004-09-11  4:33 gdr at gcc dot gnu dot org
  2004-09-12 22:54 ` [Bug c++/17413] [3.4/4.0 regression] " bangerth at dealii dot org
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-09-11  4:33 UTC (permalink / raw)
  To: gcc-bugs

Consider the following code

#include <algorithm>

int main()
{
   int a[10] = {0} ;

   struct T {
      void operator()(int) const { }
   };

   std::for_each(a, a + 10, T());
}

GCC-3.3.x used to say:

t.C: In function `int main()':
t.C:11: error: type `main()::T' composed from a local class is not a valid
   template-argument
t.C:11: error:   trying to instantiate `template<class _InputIter, class
   _Function> _Function std::for_each(_InputIter, _InputIter, _Function)'
t.C:11: error: no matching function for call to `for_each(int[10], int*,
   main()::T)'


Now, GCC-3.4.x says:

t.C: In function `int main()':
t.C:11: error: no matching function for call to `for_each(int[10], int*, main()\
::T)'


Notice that the most informative part of the diagnostic had been dropped,
leaving only the most cryptic, uninformative one.

-- 
           Summary: diagnostic regression for local classes as template
                    argument
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gdr at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: plateform independent


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
@ 2004-09-12 22:54 ` bangerth at dealii dot org
  2004-09-12 23:15 ` gdr at integrable-solutions dot net
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: bangerth at dealii dot org @ 2004-09-12 22:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-12 22:54 -------
This is related to the substitution-failure-is-not-an-error thingy: we 
realize that a local class cannot be matched against a template argument, 
so we drop the template function std::for_each from the overload list -- 
and end up with an empty list, thus the error message. 
 
We probably need to special-case the overload resolution process to handle 
this case: when we end up with an empty overload list but there is a 
function that would match were it not for a local class, we should report 
so. Whether this kind of special-casing is desirable is another matter. 
 
Reduced testcase is this: 
------------------- 
template <typename T> void foo() {}; 
 
int main () { 
  struct S {}; 
  foo<S> (); 
} 
----------------- 
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc 
x.cc: In function `int main()': 
x.cc:5: error: template-argument `main()::S' uses local type `main()::S' 
x.cc:5: error: no matching function for call to `foo()' 
g/x>  
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc: In function `int main()': 
x.cc:5: error: no matching function for call to `foo()' 
g/x>  
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc: In function `int main()': 
x.cc:5: error: no matching function for call to `foo()' 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
      Known to fail|                            |3.4.2 4.0.0
      Known to work|                            |3.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-12 22:54:43
               date|                            |
            Summary|diagnostic regression for   |[3.4/4.0 regression] local
                   |local classes as template   |classes as template argument
                   |argument                    |
   Target Milestone|---                         |3.4.3


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
  2004-09-12 22:54 ` [Bug c++/17413] [3.4/4.0 regression] " bangerth at dealii dot org
@ 2004-09-12 23:15 ` gdr at integrable-solutions dot net
  2004-09-12 23:31 ` bangerth at dealii dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-09-12 23:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-09-12 23:15 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| This is related to the substitution-failure-is-not-an-error thingy: we 
| realize that a local class cannot be matched against a template argument, 
| so we drop the template function std::for_each from the overload list -- 
| and end up with an empty list, thus the error message. 

Indeed, the whole problem is in pt.c:check_instantiated_args().  It
contains code for proper diagnostic

          tree nt = no_linkage_check (t, /*relaxed_p=*/false);

          if (nt)
            {
              if (!(complain & tf_error))
                /*OK*/;
              else if (TYPE_ANONYMOUS_P (nt))
                error ("`%T' uses anonymous type", t);
              else
                error ("`%T' uses local type `%T'", t, nt);
              result = true;
            }

But the diagnostic is not emitted because tf_error is not set in
complain. 

| We probably need to special-case the overload resolution process to handle 
| this case: when we end up with an empty overload list but there is a 
| function that would match were it not for a local class, we should report 
| so. Whether this kind of special-casing is desirable is another matter. 

I would say it is a Suboptimal implementation of SFINAE. 
In the phase where the overload-set is constructed, indeed SFINAE
is applied -- if something is invalid, just bail out without spitting
any diagnostic.  However, once the overload-set is constructed, any
error is an error.

Notice that Comeau online really does give an informative diagnostic

   "ComeauTest.c", line 11: error: a template argument may not reference
   a local type
        std::for_each(a, a + 10, T());
        ^


-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
  2004-09-12 22:54 ` [Bug c++/17413] [3.4/4.0 regression] " bangerth at dealii dot org
  2004-09-12 23:15 ` gdr at integrable-solutions dot net
@ 2004-09-12 23:31 ` bangerth at dealii dot org
  2004-09-12 23:51 ` gdr at integrable-solutions dot net
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: bangerth at dealii dot org @ 2004-09-12 23:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-12 23:31 -------
I agree that an error would be nice. I just meant to point out the reason 
why we don't get one. 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-09-12 23:31 ` bangerth at dealii dot org
@ 2004-09-12 23:51 ` gdr at integrable-solutions dot net
  2004-09-14  0:47 ` mmitchel at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-09-12 23:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-09-12 23:51 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| I agree that an error would be nice. I just meant to point out the reason 
| why we don't get one. 

I did not mean to say you're wrong.  
I'm sorry if my rant gave you the impression that I was saying you're
wrong. 
GCC is giving me headaches these days :-/

-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-09-12 23:51 ` gdr at integrable-solutions dot net
@ 2004-09-14  0:47 ` mmitchel at gcc dot gnu dot org
  2004-10-12  6:46 ` mmitchel at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-09-14  0:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-09-14 00:47 -------
Will not be fixed in GCC 3.4.x; postponed until GCC 4.0, at least.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.3                       |4.0.0


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-09-14  0:47 ` mmitchel at gcc dot gnu dot org
@ 2004-10-12  6:46 ` mmitchel at gcc dot gnu dot org
  2004-10-12  9:55 ` gdr at cs dot tamu dot edu
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-12  6:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-12 06:46 -------
The bug here is that we are checking complain at all.

SFINAE does not say that when given a set of overload candidates you perform
type deduction and then discard any candiates for which an any error occurs. 
Instead, you perform type deduction and discard any candidates for which type
deduction fails, which is a defined term in [temp.deduct].  Type deduction fails
only under precise circumstances; using a local class as a template argument is
not a case in which type deduction fails.

It looks like people have been throwing around "complain & tf_error" checks too
freely in pt.c.

The question is then what happens after type deduction succeeds.  Should we emit
an error before doing overload resolution, or only if the invalid function is
selected from the overload set?  DR 415 is a related issue and the proposed
resolution suggests that errors about invalid substitutions may be issued before
overload resolution.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-10-12  6:46 ` mmitchel at gcc dot gnu dot org
@ 2004-10-12  9:55 ` gdr at cs dot tamu dot edu
  2004-10-12 16:13 ` mmitchel at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-12  9:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at cs dot tamu dot edu  2004-10-12 09:55 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument

"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| The bug here is that we are checking complain at all.
| 
| SFINAE does not say that when given a set of overload candidates you perform
| type deduction and then discard any candiates for which an any error occurs. 
| Instead, you perform type deduction and discard any candidates for which type
| deduction fails, which is a defined term in [temp.deduct].  Type
| deduction fails only under precise circumstances; using a local
| class as a template argument is not a case in which type deduction fails.

Absolutely.

| It looks like people have been throwing around "complain & tf_error"
| checks too freely in pt.c.

Amen.

| The question is then what happens after type deduction succeeds.
| Should we emit an error before doing overload resolution, or only if
| the invalid function is selected from the overload set?  DR 415 is a
| related issue and the proposed resolution suggests that errors about
| invalid substitutions may be issued before overload resolution.

My inclination is to emit the error only if the invalid function is
selected from the overload set.  I can see where DR 415 is heading,
and I think its general concern will no doubt be discussed in Redmond
or following as it affects large part of C++ evolution.

In the mean time, I would recommend we emit the error only if the
invalid function is selected.

-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-10-12  9:55 ` gdr at cs dot tamu dot edu
@ 2004-10-12 16:13 ` mmitchel at gcc dot gnu dot org
  2004-10-12 18:51 ` gdr at cs dot tamu dot edu
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-12 16:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-12 16:13 -------
As in the discussion of DR 415, it's not feasible to postpone all error messages
until overload resolution has succeeded.  The example in DR 415 is that you
might need to instantiate a class type to do type deduction.  If the class has
an invalid member upon instantiation, it makes sense to complain then, not later
when the function that required that instantiation is selected.

The language (which John Spicer is trying to clarify) leads to another
complication.  [temp.over] says:

  template  argument  deduction  (_temp.deduct_)
  and  checking of any explicit template arguments (_temp.arg_) are per-
  formed for each function template to find the template argument values
  (if any) that can be used with that function template to instantiate a
  function template specialization that can be  invoked  with  the  call
  arguments.   For each function template, if the argument deduction and
  checking succeeds, the template-arguments  (deduced  and/or  explicit)
  are  used  to  instantiate  a  single function template specialization
  which is added to the candidate functions set to be used  in  overload
  resolution.   If,  for  a  given function template, argument deduction
  fails, no such function is added to the set of candidate functions for
  that  template.

This section does not clearly specify what happens if argument deduction
succeeds, but the checking of explict template arguments (as per [temp.arg]) fails.

Consider:

  template <typename T>
  void f(T *);

  void g() {
    struct S;
    S* p;
    f (p);     // #1
    f<S> (p);  // #2
  }

If we treated deduction and explicit arguments differently, then we would put
the template in the overload set at #1 (deduction succeeds) but not at #2
(checking of explicit arguments fails).  That's odd.

John (and I) think that "instantiate" is the wrong term in the passage quoted
above, in the sense that this should not be a point-of-instantiation, I do
think, however, that the compiler must generate a declaration of the function
template, after instantiation, for use during overload resolution.  That is the
natural time to issue errors about the function.  Otherwise, you must queue a
possibly arbitrary error or set of errors to issue later, iff the template is
instantiated.  It's not reasonable to ask that of the implementation.

For all these reasons, I intend to fix this by issuing an error message before
overload resolution.

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-10-12 16:13 ` mmitchel at gcc dot gnu dot org
@ 2004-10-12 18:51 ` gdr at cs dot tamu dot edu
  2004-12-12 21:54 ` pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-12 18:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at cs dot tamu dot edu  2004-10-12 18:51 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument

"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

[...]

| Consider:
| 
|   template <typename T>
|   void f(T *);
| 
|   void g() {
|     struct S;
|     S* p;
|     f (p);     // #1
|     f<S> (p);  // #2
|   }
| 
| If we treated deduction and explicit arguments differently, then we would put
| the template in the overload set at #1 (deduction succeeds) but not at #2
| (checking of explicit arguments fails).  That's odd.

The difference between deduction and explicit arguments are already
deep; there is no thing odd about it.  They are just not the same
thing and they don't work the same way.
Explicit arguments in general constructs different overload sets
than deduction.  Furthermore, the former allows implicit conversion
and the later does not.  Consider

    template<class>  struct X { }
    template<class T> f(T*);
    template<class T> f(X<T>*);

     void g() {
        struct S : X<int> { };
        S* p;
        f(p);
        f<S>(p);
        f<int>(p);
     };

| John (and I) think that "instantiate" is the wrong term in the passage quoted
| above, in the sense that this should not be a point-of-instantiation, I do
| think, however, that the compiler must generate a declaration of the function
| template, after instantiation, for use during overload resolution.  That is the
| natural time to issue errors about the function.  Otherwise, you must queue a
| possibly arbitrary error or set of errors to issue later, iff the template is
| instantiated.  It's not reasonable to ask that of the implementation.
| 
| For all these reasons, I intend to fix this by issuing an error message before
| overload resolution.

I understand your point of view, but I don't think I agree with it.

I suppose we'll have plenty time to review this point in Redmond or
later.

-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-10-12 18:51 ` gdr at cs dot tamu dot edu
@ 2004-12-12 21:54 ` pinskia at gcc dot gnu dot org
  2004-12-22  3:35 ` cvs-commit at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-12 21:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-12-12 21:54 ` pinskia at gcc dot gnu dot org
@ 2004-12-22  3:35 ` cvs-commit at gcc dot gnu dot org
  2004-12-23 18:25 ` mmitchel at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-22  3:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-22 03:35 -------
Subject: Bug 17413

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-12-22 03:34:59

Modified files:
	gcc/cp         : ChangeLog call.c decl.c parser.c tree.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: packed8.C 
	gcc/testsuite/g++.dg/template: crash31.C crash30.C 

Log message:
	PR c++/18378
	* call.c (convert_like_real): Do not permit the use of a copy
	constructor to copy a packed field.
	
	PR c++/17413
	* decl.c (grokdeclarator): Return error_mark_node, not
	void_type_node, to indicate errors.
	* parser.c (cp_parser_template_parameter_list): Robustify.
	(cp_parser_template_parameter): Likewise.
	
	PR c++/19034
	* tree.c (cp_tree_equal): Handle OVERLOAD.
	
	PR c++/18378
	* g++.dg/ext/packed8.C: New test.
	
	PR c++/13268
	* g++.dg/template/crash31.C: New test.
	
	PR c++/19034
	* g++.dg/template/crash30.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4550&r2=1.4551
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.523&r2=1.524
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1345&r2=1.1346
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.296&r2=1.297
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.420&r2=1.421
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed8.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash31.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash30.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4796&r2=1.4797



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2004-12-22  3:35 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-23 18:25 ` mmitchel at gcc dot gnu dot org
  2004-12-23 19:50 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-12-23 18:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-12-23 18:25 -------
The patch is the previous comment does not actually apply to this PR.

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2004-12-23 18:25 ` mmitchel at gcc dot gnu dot org
@ 2004-12-23 19:50 ` mmitchel at gcc dot gnu dot org
  2004-12-23 19:54 ` cvs-commit at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-12-23 19:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-12-23 19:50 -------
The code in the PR is clearly invalid, as it explicitly uses a local class as an
explicit template arugment.  However, the broader question is how to perform
overload resolution when argument deduction has deduced a local class as a
template argument.

The pluasible choices are one of (a) that function being excluded from the set
of overloaded function candidates, (b) an error when deduction is being
performed, or (c) an error only if that function is selected.

GCC presently implements (a), but that means that the set of overloaded
candidates considered changes depending merely on whether or not one of the
function arguments happens to be a local class.  That seems undesirable. 
Furthermore, it's a clear violation of the standard, which lists clearly the
cases in which SFINAE applies; using a local class as an argument is not one of
them.

Here is a test case that distinguishes (a) from the other other choices:

  struct A {};
  A* a;

  void f(A*);
  template <typename T>
  void f(T*);

  void g() {
    f(a); // Calls the non-template function.                                   

    struct B : public A {};
    B* b = 0;

    f(b); // Overload resolution will select f<B*>(B*) if the template          
          // candidate is included in the overload set.  As a local type        
          // cannot be a template argument, that will result in an error        
          // message.  If the template candidate is not included in the         
          // overload set, then the non-template function will be               
          // accepted.                                                          
  }

G++ presently accepts this code.

The previous debate has centered on whether (b) or (c) is a better choice. 
However, I do not think there is an actual difference between (b) or (c).  If
template argument deduction succeeds, overload resolution is guaranteed to find
that function to be a viable function.  So, the only question is whether it will
be the best.  It will be better than any non-template function, because
non-template functions cannot possibly involve local classes as argument types.
 And any template function which was more specialized would also have to involve
the local class in its argument types.  For example, I do not think there is any
other overload of "f" that can be added above that would be selected over the
template version, but which would not also involve a local class type.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2004-12-23 19:50 ` mmitchel at gcc dot gnu dot org
@ 2004-12-23 19:54 ` cvs-commit at gcc dot gnu dot org
  2004-12-23 20:01 ` [Bug c++/17413] [3.4 " mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-23 19:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-23 19:54 -------
Subject: Bug 17413

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-12-23 19:54:09

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite/g++.dg/template: crash19.C 
Added files:
	gcc/testsuite/g++.dg/template: local4.C 

Log message:
	PR c++/17413
	* pt.c (check_instantiated_args): Remove bogus SFINAE code.
	
	PR c++/17413
	* g++.dg/template/local4.C: New test.
	* g++.dg/template/crash19.C: Add dg-error marker.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4808&r2=1.4809
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4557&r2=1.4558
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.961&r2=1.962
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/local4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash19.C.diff?cvsroot=gcc&r1=1.2&r2=1.3



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2004-12-23 19:54 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-23 20:01 ` mmitchel at gcc dot gnu dot org
  2004-12-23 20:31 ` gdr at integrable-solutions dot net
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-12-23 20:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-12-23 20:00 -------
Fixed in G++ 4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|3.4.2 4.0.0                 |3.4.2
      Known to work|3.3.4                       |3.3.4 4.0.0
            Summary|[3.4/4.0 regression] local  |[3.4 regression] local
                   |classes as template argument|classes as template argument


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2004-12-23 20:01 ` [Bug c++/17413] [3.4 " mmitchel at gcc dot gnu dot org
@ 2004-12-23 20:31 ` gdr at integrable-solutions dot net
  2005-01-13  0:39 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-12-23 20:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-12-23 20:30 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument


I agree with your analysis.  Thanks for the time you put into this.
I record it for future references in EWG.

-- Gaby
 


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2004-12-23 20:31 ` gdr at integrable-solutions dot net
@ 2005-01-13  0:39 ` pinskia at gcc dot gnu dot org
  2005-05-19 17:27 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13  0:39 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.0                       |3.4.4


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2005-01-13  0:39 ` pinskia at gcc dot gnu dot org
@ 2005-05-19 17:27 ` mmitchel at gcc dot gnu dot org
  2005-05-29 17:58 ` mark at codesourcery dot com
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2005-05-19 17:27 ` mmitchel at gcc dot gnu dot org
@ 2005-05-29 17:58 ` mark at codesourcery dot com
  2005-06-17 22:14 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mark at codesourcery dot com @ 2005-05-29 17:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2005-05-29 17:18 -------
Subject: Re:  [3.4 regression] local classes as template argument

Geoffrey Keating wrote:
> Hi Mark,
> 
> Consider this code:
> 
> struct Attribute { };
> template <class T> void fun (const Attribute &attr, const T &value);
> extern void fun (int attr, int value);
> enum { anon = 666 };
> 
> void test(int foo)
> { fun (foo, anon); }
> 
> I believe this is valid C++.  Template argument deduction will fail  
> when it compares the type of the *first* parameter of fun(), since no  
> value of T can be found that will make the first parameter match.

As you've discovered, we don't perform template argument deduction on 
arguments that do not involve template types.  I agree that there's 
nothing in the standard to support that behavior.  However, there are a 
lot of DRs in this area, and we should check the behavior of other 
compilers before making any changes here.  Those checks should be done 
without using anonymous enums, since there's additional controversy 
around that particular issue; instead, some way to isolate what set of 
template functions can be deduced is required.

I don't remember the origin of the comment in the code that refers to 
infinite recursion.  I don't think adding DEDUCE_CALL to the condition 
makes sense, though; either we should always do the comparsion, or only 
when DEDUCE_EXACT.  Furthermore, your change is not correct, in that 
deduction permits non-exact matches for calls; see [temp.deduct.call].



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2005-05-29 17:58 ` mark at codesourcery dot com
@ 2005-06-17 22:14 ` cvs-commit at gcc dot gnu dot org
  2005-07-28 10:25 ` giovannibajo at libero dot it
  2005-07-28 10:26 ` cvs-commit at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-17 22:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-17 22:13 -------
Subject: Bug 17413

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	geoffk@gcc.gnu.org	2005-06-17 22:13:36

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog pt.c 
Added files:
	gcc/testsuite/g++.dg/template: local5.C 

Log message:
	2005-06-17  Geoffrey Keating  <geoffk@apple.com>
	
	PR c++/17413
	* pt.c (type_unification_real): Apply template type deduction even
	to procedure parameters that are not dependent on a template
	parameter.
	
	Index: testsuite/ChangeLog
	2005-06-17  Geoffrey Keating  <geoffk@apple.com>
	
	PR c++/17413
	* g++.dg/template/local5.C: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5649&r2=1.5650
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/local5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4794&r2=1.4795
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1007&r2=1.1008



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2005-06-17 22:14 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-28 10:25 ` giovannibajo at libero dot it
  2005-07-28 10:26 ` cvs-commit at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: giovannibajo at libero dot it @ 2005-07-28 10:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-07-28 10:24 -------
Fixed also for GCC 3.4.5.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/17413] [3.4 regression] local classes as template argument
  2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2005-07-28 10:25 ` giovannibajo at libero dot it
@ 2005-07-28 10:26 ` cvs-commit at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-28 10:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-28 10:23 -------
Subject: Bug 17413

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	giovannibajo@gcc.gnu.org	2005-07-28 10:22:23

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog call.c parser.c pt.c 
	gcc/testsuite/g++.dg/parse: crash11.C crash13.C 
Added files:
	gcc/testsuite/g++.dg/ext: packed8.C 
	gcc/testsuite/g++.dg/parse: error18.C 
	gcc/testsuite/g++.dg/template: crash25.C local5.C typedef2.C 

Log message:
	Backport:
	
	2004-09-16  Mark Mitchell  <mark@codesourcery.com>
	PR c++/16002
	* parser.c (cp_parser_simple_declaration): Commit to tentative
	parses after seeing a decl-specifier.
	(cp_parser_simple_declaration): Eliminate spurious message.
	(cp_parser_init_declarator): Adjust error message.
	
	2005-06-17  Geoffrey Keating  <geoffk@apple.com>
	PR c++/17413
	* pt.c (type_unification_real): Apply template type deduction even
	to procedure parameters that are not dependent on a template
	parameter.
	
	2004-11-02  Mark Mitchell  <mark@codesourcery.com>
	PR c++/18124
	* parser.c (cp_parser_type_parameter): Robustify.
	PR c++/18155
	* parser.c (cp_parser_single_declaration): Disallow template
	typedefs.
	(cp_parser_typedef_p): New function.
	
	2004-12-21  Mark Mitchell  <mark@codesourcery.com>
	PR c++/18378
	* call.c (convert_like_real): Do not permit the use of a copy
	constructor to copy a packed field.
	
	Backport:
	
	2004-09-16  Mark Mitchell  <mark@codesourcery.com>
	PR c++/16002
	* g++.dg/parse/error18.C: New test.
	* g++.dg/parse/crash11.C: Adjust error markers.
	
	2005-06-17  Geoffrey Keating  <geoffk@apple.com>
	PR c++/17413
	* g++.dg/template/local5.C: New.
	
	2004-11-02  Mark Mitchell  <mark@codesourcery.com>
	PR c++/18124
	* g++.dg/template/crash25.C: New test.
	PR c++/18155
	* g++.dg/template/typedef2.C: New test.
	* g++.dg/parse/crash13.C: Adjust error markers.
	
	2004-12-21  Mark Mitchell  <mark@codesourcery.com>
	PR c++/18378
	* g++.dg/ext/packed8.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.411&r2=1.3389.2.412
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.228&r2=1.3892.2.229
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.452.2.26&r2=1.452.2.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.57&r2=1.157.2.58
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.56&r2=1.816.2.57
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed8.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.42.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error18.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1.12.3&r2=1.1.12.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash11.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2&r2=1.2.24.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash13.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1&r2=1.1.14.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash25.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.38.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/local5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.14.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typedef2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.38.1



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2005-07-28 10:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-11  4:33 [Bug c++/17413] New: diagnostic regression for local classes as template argument gdr at gcc dot gnu dot org
2004-09-12 22:54 ` [Bug c++/17413] [3.4/4.0 regression] " bangerth at dealii dot org
2004-09-12 23:15 ` gdr at integrable-solutions dot net
2004-09-12 23:31 ` bangerth at dealii dot org
2004-09-12 23:51 ` gdr at integrable-solutions dot net
2004-09-14  0:47 ` mmitchel at gcc dot gnu dot org
2004-10-12  6:46 ` mmitchel at gcc dot gnu dot org
2004-10-12  9:55 ` gdr at cs dot tamu dot edu
2004-10-12 16:13 ` mmitchel at gcc dot gnu dot org
2004-10-12 18:51 ` gdr at cs dot tamu dot edu
2004-12-12 21:54 ` pinskia at gcc dot gnu dot org
2004-12-22  3:35 ` cvs-commit at gcc dot gnu dot org
2004-12-23 18:25 ` mmitchel at gcc dot gnu dot org
2004-12-23 19:50 ` mmitchel at gcc dot gnu dot org
2004-12-23 19:54 ` cvs-commit at gcc dot gnu dot org
2004-12-23 20:01 ` [Bug c++/17413] [3.4 " mmitchel at gcc dot gnu dot org
2004-12-23 20:31 ` gdr at integrable-solutions dot net
2005-01-13  0:39 ` pinskia at gcc dot gnu dot org
2005-05-19 17:27 ` mmitchel at gcc dot gnu dot org
2005-05-29 17:58 ` mark at codesourcery dot com
2005-06-17 22:14 ` cvs-commit at gcc dot gnu dot org
2005-07-28 10:25 ` giovannibajo at libero dot it
2005-07-28 10:26 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).