diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-21 05:50:53 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-21 05:50:53 +0000 |
commit | 76fc75783853a9a5c8249147d30cea3f0f7ede2c (patch) | |
tree | 26ff80d4db49e40d7a6cd3b4aecb0273a39a8fe5 /gcc/testsuite | |
parent | 6c0134fc28e45a00f0c6f0e91b938acb3aef68fd (diff) | |
download | gcc-76fc75783853a9a5c8249147d30cea3f0f7ede2c.tar.gz |
PR c++/11834
* pt.c (more_specialized): Bump processing_template_decl.
PR c++/11834
* g++.dg/template/deduce2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/deduce2.C | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e1135243f4..567065258e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-08-20 Mark Mitchell <mark@codesourcery.com> + + PR c++/11834 + * g++.dg/template/deduce2.C: New test. + 2003-08-21 Josef Zlomek <zlomekj@suse.cz> * gcc.c-torture/execute/20030821-1.c: New test. diff --git a/gcc/testsuite/g++.dg/template/deduce2.C b/gcc/testsuite/g++.dg/template/deduce2.C new file mode 100644 index 00000000000..bcf77b30b78 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/deduce2.C @@ -0,0 +1,30 @@ +template <typename T0> struct tuple { + typedef tuple<int> tail; +}; + +template <> struct tuple<int> { +}; + +template <typename L> +struct length { + static const int i = length<typename tuple<L>::tail>::i; +}; + +template<> +struct length<tuple<int> > { + static const int i = 1; +}; + +template <int> struct M {}; + +template <typename A> +M<length<tuple<A> >::i > foo (A*); + +template <typename A> +M<length<tuple<A> >::i> foo (const A*); + +const int i1 = 3; + +void bar() { + foo (&i1); +} |