[cfe-dev] More thoughts on user defined literals
eli.friedman at gmail.com
Wed Jul 8 18:36:46 PDT 2009
On Wed, Jul 8, 2009 at 6:24 PM, AlisdairM(public)<public at alisdairm.net> wrote:
> What if the ud-suffix was its own token though?
> The lexer could flag this token as tok::literal_suffix, and we could embed the IdentifierInfo as with a regular identifier. Ultimately a user-defined literal is a disguised function call, rather than a literal value, and the evaluation of that function could be any type quite unrelated to the preceding literal. I am increasingly uncomfortable combining this information with a string literal (or character etc.)
It probably doesn't matter too much whether the tokens are separate; I
just think it needs to be resolved in the lexer. It sounded like you
were intending to reuse tok::identifier for these suffixes, and that
sounds like a bad idea.
More information about the cfe-dev