Lines Matching full:diagnostic
48 when the code is incorrect or dubious. In Clang, each diagnostic produced has
53 number of source ranges that related to the diagnostic.
58 implemented. A representative example of a diagnostic is:
68 the source ranges "``~~~~``", arguments to the diagnostic ("``int*``" and
70 backing the diagnostic :).
74 a new diagnostic.
76 The ``Diagnostic*Kinds.td`` files
80 ``clang/Basic/Diagnostic*Kinds.td`` files, depending on what library will be
82 diagnostic, the severity of the diagnostic and the English translation + format
87 Since the enum is referenced in the C++ code that produces the diagnostic, it
90 The severity of the diagnostic comes from the set {``NOTE``, ``REMARK``,
105 These *severities* are mapped into a smaller set (the ``Diagnostic::Level``
110 you to map almost any diagnostic to the output level that you want. The only
112 severity of the previously emitted diagnostic and ``ERROR``\ s, which can only
116 Diagnostic mappings are used in many ways. For example, if the user specifies
129 The format string for the diagnostic is very simple, but it has some power. It
131 arguments to the diagnostic are inserted and formatted. For example, here are
144 plain ASCII character in the diagnostic string except "``%``" without a
147 in the output, use the "``%%``" escape sequence, like the third diagnostic.
149 arguments to the diagnostic are formatted.
151 Arguments to the diagnostic are numbered according to how they are specified by
154 diagnostic, you are doing something wrong :). Unlike ``printf``, there is no
155 requirement that arguments to the diagnostic end up in the output in the same
164 ``DiagnosticKinds.td`` file. This avoids the diagnostic wrapping when
166 with the diagnostic.
170 * Do not capitalize the diagnostic string, and do not end it with a period.
171 * If you need to quote something in the diagnostic string, use single quotes.
178 localized diagnostic). The exceptions to this are C/C++ language keywords
185 Formatting a Diagnostic Argument
195 Here are the different diagnostic argument formats currently supported by
220 English string argument. Instead of specifying the string, the diagnostic
226 diagnostic instead of having to do things textually. The selected string
315 printed after the diagnostic message.
324 Producing the Diagnostic
327 Now that you've created the diagnostic in the ``Diagnostic*Kinds.td`` file, you
329 diagnostic. Various components of Clang (e.g., the preprocessor, ``Sema``,
330 etc.) provide a helper function named "``Diag``". It creates a diagnostic and
343 :ref:`SourceLocation <SourceLocation>` object) and a diagnostic enum value
344 (which matches the name from ``Diagnostic*Kinds.td``). If the diagnostic takes
346 becomes ``%0``, the second becomes ``%1``, etc. The diagnostic interface
353 diagnostic is pretty straightforward.
356 correctly. The good news is that the call site that issues a diagnostic should
357 be completely independent of how the diagnostic is formatted and in what
367 diagnostic and recover gracefully in these and other cases.
369 However, for these cases where the fix is obvious, the diagnostic can be
371 change the code referenced by the diagnostic to fix the problem. For example,
388 abstract manner, which the text diagnostic printer renders as a line of
389 "insertions" below the caret line. :ref:`Other diagnostic clients
405 should be attached to the diagnostic using the ``<<`` operator in the same way
406 that highlighted source ranges and arguments are passed to the diagnostic.
428 Once code generates a diagnostic with all of the arguments and the rest of the
430 mentioned, the diagnostic machinery goes through some filtering to map a
431 severity onto a diagnostic level, then (assuming the diagnostic is not mapped
465 Not possible yet! Diagnostic strings should be written in UTF-8, the client can
467 replaces the format string for the diagnostic.
489 for a diagnostic.
737 used by the diagnostic checker to identifier expect-error annotations.
1554 ``SourceLocation`` for where the problem is, and a diagnostic ID that explains
1555 the problem. The diagnostic should have ``ERROR`` type.
1558 ``SourceLocation`` for where the problem is, and a diagnostic ID that
1559 explains the problem. The diagnostic should have ``EXTENSION`` type.
1566 i-c-e, the ``EXTENSION`` diagnostic is emitted. Finally it would return
1678 generate an ignored attribute diagnostic when used, which may be useful when an
1720 to attach to a subject that is not in the subject list, a diagnostic is issued
1721 automatically. Whether the diagnostic is a warning or an error depends on how
1724 subjects in the list, but a custom diagnostic parameter can also be specified in
1731 to automatically determine the diagnostic parameter in `utils/TableGen/ClangAttrEmitter.cpp
1743 specified in a SubjectList, a custom diagnostic parameter must also be provided.
1745 Diagnostic checking for attribute subject lists is automated except when
1839 "attribute ignored" warning diagnostic is emitted. Since language options are
1903 is only a single diagnostic, it is permissible to use ``InGroup<DiagGroup<"your-attribute">>``