[Bug c++/13092] [3.4/3.5 regression] Segfault in convert_nontype_argument

lerdsuwa at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 24 10:51:00 GMT 2004


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2004-01-24 10:51 -------
An example why access checking has to be done later can be seen from
the testcase non-dependent9.C in the patch.  In the following code:

  template <class T> void fr ()
  {
    ...
    X<&D2::i> x1;			// { dg-error "context" }
    ...

we are parsing '&D2::i' and call 'convert_nontype_argument' to see if the
argument is valid.  We can't compute access yet because the function 'fr' 
is still a template.  We have to wait until 'fr' is instantiated to see
if this particular specialization is a friend of 'D2'.  The check is done
in 'tsubst_qualified_id' during template instantiation.

-- 


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



More information about the Gcc-bugs mailing list