mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 01:50:34 +08:00
re PR c++/23293 (Misleading names in diagnostics for typedefs in functions)
PR c++/23293 * pt.c (convert_template_argument): Use canonical type variants in template specializations. PR c++/23293 * g++.dg/template/error19.C: New test. From-SVN: r105561
This commit is contained in:
parent
c19aaba573
commit
685e39c289
@ -1,3 +1,9 @@
|
||||
2005-10-18 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/23293
|
||||
* pt.c (convert_template_argument): Use canonical type variants in
|
||||
template specializations.
|
||||
|
||||
2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/21383
|
||||
|
@ -3930,6 +3930,13 @@ convert_template_argument (tree parm,
|
||||
}
|
||||
else
|
||||
val = arg;
|
||||
/* We only form one instance of each template specialization.
|
||||
Therefore, if we use a non-canonical variant (i.e., a
|
||||
typedef), any future messages referring to the type will use
|
||||
the typedef, which is confusing if those future uses do not
|
||||
themselves also use the typedef. */
|
||||
if (TYPE_P (val))
|
||||
val = canonical_type_variant (val);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-10-18 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/23293
|
||||
* g++.dg/template/error19.C: New test.
|
||||
|
||||
2005-10-18 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/21383
|
||||
|
22
gcc/testsuite/g++.dg/template/error19.C
Normal file
22
gcc/testsuite/g++.dg/template/error19.C
Normal file
@ -0,0 +1,22 @@
|
||||
// PR c++/23293
|
||||
|
||||
template < typename > struct P;
|
||||
struct S;
|
||||
|
||||
void *unrelated_function()
|
||||
{
|
||||
typedef S K;
|
||||
P < K > * p;
|
||||
return p;
|
||||
}
|
||||
|
||||
template < typename U >
|
||||
void generate_warning()
|
||||
{
|
||||
U::x(); // { dg-error "P<S>" }
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
generate_warning< P < S > >();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user