On 11/06/12, Jason Merrill<ja...@redhat.com> wrote:
 
> Why three separate flags?

I thought extra flexibility might be wanted.  On the other hand, *I* would 
never turn off just one set.  I expect a food fight over all flags.  Also, if, 
as seems reasonable, strict ANSI turns off all gnu suffixes then having one 
flag for all seems sufficient and would cover most cases.

Also, if a user tries to create a fixed-point literal in C++ you get an error 
about not supported fixed-point anyway.  So maybe this should always be 
referred to user-defined literals without a flag?

Finally, these machine-defined literals seem obscure to me.

So how about
  -f[no-]ext-numeric-literals
or maybe
  -f[no-]gnu-numeric-literals
for everything?

> 
> The flag(s) need(s) to be documented in doc/invoke.texi.

OK.

> 
> > @@ -721,7 +733,12 @@
> > case OPT_std_c__1y:
> > case OPT_std_gnu__1y:
> > if (!preprocessing_asm_p)
> > - set_std_cxx1y (code == OPT_std_c__11 /* ISO */);
> > + {
> > + set_std_cxx1y (code == OPT_std_c__11 /* ISO */);
> > + cpp_opts->imaginary_literals = 0;
> > + cpp_opts->fixed_point_literals = 0;
> > + cpp_opts->machine_defined_literals = 0;
> > + }
> 
> I think I would disable the built-in extension in both C++11 and C++1y 
> if we're in ISO mode, and leave it enabled if we're in GNU mode.
> 

I'll do this.

> I think the ideal behavior for these suffixes would be to treat them as 
> user-defined literals if a corresponding literal operator is available, 
> or use the built-in extension if not. But that doesn't need to happen now.

I thought about that.  We'd need some machinery that would allow cpp to query 
what has been declared already.  Maybe it's already there?

> 
> Jason

Thanks for looking at this.

Ed

Reply via email to