On Fri, Dec 21, 2012 at 10:25 AM, Dodji Seketeli <do...@redhat.com> wrote: > Gabriel Dos Reis <g...@integrable-solutions.net> writes: > >> The example is valid, but I am not sure I understand your >> explanation... > > Ah, sorry. I realize just now that I haven't mentioned the initial > erratic behaviour. Maybe that could have made my message easier to > understand. > > So consider the test case of the message: > > 1 template<typename> > 2 using A = int; > 3 > 4 template<template<class> class> > 5 struct B {}; > 6 > 7 B<A> b; > > test.cc:7:4: error: integral expression ‘A’ is not constant > B<A> b; > ^ > Followed by some irrelevant other error messages. > > As I was saying my earlier message, here, the TREE_TYPE of the > template_decl A is an integer; so check_instantiated_arg takes it as > if A is an integer value (a decl with integer type), and thus, should > be a constant. > > The fix I am proposing is just to allow check_instantiated_arg to make > the difference between a classical integer decl, and an alias template > which type-id is an integer. > > -- > Dodji
Hi Dodji, Thank you very much for the explanation; your previous message makes sense to me now. The question I have is why are we using TREE_TYPE of a TEMPLATE_DECL to represent the current instantiation of a template alias? Should not we use TEMPLATE_RESULT instead? -- Gaby