Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r6d2aa7ed r2348881  
    3636// Warnings
    3737
    38 enum class Severity {
    39         Suppress,
    40         Warn,
    41         Error,
    42         Critical
    43 };
    44 
    45 struct WarningData {
    46         const char * const name;
    47         const char * const message;
    48         mutable Severity severity;
    49 };
    50 
    51 constexpr const WarningData WarningFormats[] = {
    52         {"self-assign"         , "self assignment of expression: %s"           , Severity::Warn},
    53         {"reference-conversion", "rvalue to reference conversion of rvalue: %s", Severity::Warn},
     38constexpr const char * const WarningFormats[] = {
     39        "self assignment of expression: %s",
     40        "rvalue to reference conversion of rvalue: %s",
    5441};
    5542
     
    6552);
    6653
    67 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__)
     54// ## used here to allow empty __VA_ARGS__
     55#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], ## __VA_ARGS__)
    6856
    6957void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
Note: See TracChangeset for help on using the changeset viewer.