re PR c++/2184 (using declarations for classes in function templates)
cp: PR c++/2184 * decl2.c (do_local_using_decl): Push the decls, even in a template. testsuite: * g++.old-deja/g++.pt/using1.C: Adjust. * g++.old-deja/g++.pt/using2.C: New test. From-SVN: r42526
This commit is contained in:
parent
8948cb3972
commit
6f56d9253f
@ -1,3 +1,9 @@
|
|||||||
|
2001-05-24 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
PR c++/2184
|
||||||
|
* decl2.c (do_local_using_decl): Push the decls, even in a
|
||||||
|
template.
|
||||||
|
|
||||||
2001-05-22 Mark Mitchell <mark@codesourcery.com>
|
2001-05-22 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* optimize.c (initialize_inlined_parameters): Don't set
|
* optimize.c (initialize_inlined_parameters): Don't set
|
||||||
|
@ -5136,8 +5136,6 @@ do_local_using_decl (decl)
|
|||||||
if (building_stmt_tree ()
|
if (building_stmt_tree ()
|
||||||
&& at_function_scope_p ())
|
&& at_function_scope_p ())
|
||||||
add_decl_stmt (decl);
|
add_decl_stmt (decl);
|
||||||
if (processing_template_decl)
|
|
||||||
return;
|
|
||||||
|
|
||||||
oldval = lookup_name_current_level (name);
|
oldval = lookup_name_current_level (name);
|
||||||
oldtype = lookup_type_current_level (name);
|
oldtype = lookup_type_current_level (name);
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2001-05-24 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
* g++.old-deja/g++.pt/using1.C: Adjust.
|
||||||
|
* g++.old-deja/g++.pt/using2.C: New test.
|
||||||
|
|
||||||
2001-05-23 Neil Booth <neil@daikokuya.demon.co.uk>
|
2001-05-23 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||||
|
|
||||||
* gcc.dg/cpp/charconst.c: New tests.
|
* gcc.dg/cpp/charconst.c: New tests.
|
||||||
|
@ -15,6 +15,8 @@ template <class T> void f()
|
|||||||
|
|
||||||
template void f<float> ();
|
template void f<float> ();
|
||||||
|
|
||||||
|
int foo (int) { return 0;}
|
||||||
|
|
||||||
namespace B
|
namespace B
|
||||||
{
|
{
|
||||||
int foo (int) { return 1;}
|
int foo (int) { return 1;}
|
||||||
@ -28,8 +30,6 @@ namespace B
|
|||||||
template int baz<float> ();
|
template int baz<float> ();
|
||||||
};
|
};
|
||||||
|
|
||||||
int foo (int) { return 0;}
|
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
return B::baz<float> ();
|
return B::baz<float> ();
|
||||||
|
26
gcc/testsuite/g++.old-deja/g++.pt/using2.C
Normal file
26
gcc/testsuite/g++.old-deja/g++.pt/using2.C
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Build don't link:
|
||||||
|
//
|
||||||
|
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||||
|
// Contributed by Nathan Sidwell 22 May 2001 <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
// Bug 2184. Using decls in templates weren't doing the right thing.
|
||||||
|
|
||||||
|
namespace N {
|
||||||
|
template <class T>
|
||||||
|
class vector {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void g(const int&) {
|
||||||
|
using N::vector;
|
||||||
|
typedef vector<int> V;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class J>
|
||||||
|
void f(const J&) {
|
||||||
|
using N::vector;
|
||||||
|
typedef vector<int> V;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
f(0);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user