forked from gcc-mirror/gcc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pt.c (verify_class_unification): Don't check if PARM is template parameter dependent. Simplify. (unify) [TEMPLATE_PARM_INDEX]: Handle when ARG is a template parameter dependent expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53517 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
lerdsuwa
committed
May 16, 2002
1 parent
664dca4
commit 66da0ae
Showing
3 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// { dg-do run } | ||
// Origin: Jo Totland <jototland@hotmail.com> | ||
|
||
// PR c++/6620 | ||
// Partial specialization involving expression of non-type template | ||
// parameter causes ICE. | ||
|
||
extern "C" void abort(); | ||
|
||
template <int N> struct HoldInt | ||
{ | ||
}; | ||
|
||
template <class A, class B> struct Add | ||
{ | ||
}; | ||
|
||
template <int N> struct Add<HoldInt<N>, HoldInt<-N> > | ||
{ | ||
typedef int type; | ||
int f() { return 0; } | ||
}; | ||
|
||
template <int N, int M> | ||
struct Add<HoldInt<N>, HoldInt<M> > | ||
{ | ||
typedef HoldInt<N+M> type; | ||
int f() { return 1; } | ||
}; | ||
|
||
int main() { | ||
Add<HoldInt<1>, HoldInt<-1> > a; | ||
Add<HoldInt<1>, HoldInt<-2> > b; | ||
if (a.f() != 0 || b.f() != 1) | ||
abort(); | ||
} |