[cfe-dev] integer constant expression oh my!

Doug Gregor doug.gregor at gmail.com
Mon Nov 17 10:47:18 PST 2008


On Mon, Nov 17, 2008 at 1:44 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Nov 17, 2008 at 9:57 AM, Doug Gregor <doug.gregor at gmail.com> wrote:
>> On Mon, Nov 17, 2008 at 12:47 PM, Sebastian Redl
>> <sebastian.redl at getdesigned.at> wrote:
>> This also means that one can end up instantiating a template as part
>> of the evaluation of an integral constant expression (if that template
>> is a constexpr function template). I think the only real effect this
>> has on the design is that the ICE checking and expression evaluation
>> code will need to move from AST into Sema.
>
> Don't we have to instantiate the correct template in Sema as part of
> typechecking?  And isn't that before we might want to evaluate an
> expression using the template in question?

We have to instantiate the correct template *declaration* as part of
type-checking. We don't have to instantiation the template
*definition* until we try to evaluate the value of the expression.

  - Doug



More information about the cfe-dev mailing list