[cfe-commits] [PATCH] Improved diagnostics for literal operators

David Majnemer david.majnemer at gmail.com
Fri Jun 17 14:04:51 PDT 2011


Hi,

This patch implements improved diagnostics for literal operators. I
may have gone a little overboard with the number of different
diagnostics, I can trim it down if it is decided to be excessive. It
also diagnoses when there is an underscore in a string literal with an
ExtWarn as [usrlit.suffix] says that this is reserved for future
standardization.

Determining if a declaration was a literal operator vs a literal
operator template was modified. I make the distinction based off of
the existence or lack of a template-parameter-list instead of the
number of operands.

I decided to only include the suffix in the messages as all literal
operator suffixes all have 'operator ""' which would just add noise to
the output.

Lastly, I only emit a single diagnostic when encountering an error and
bail. I could diagnose more errors in a single go but I don't know how
much more helpful it is.

Comments and suggestions are recommended.

-- 
David Majnemer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: literal_operator_diagnostics.patch
Type: application/octet-stream
Size: 18196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110617/fd954ed4/attachment.obj>


More information about the cfe-commits mailing list