Ignore:
Timestamp:
May 18, 2018, 2:09:21 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
2472a19
Parents:
f6f0cca3 (diff), c7d8100c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/master' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    rf6f0cca3 rff29f08  
    77// SemanticError.h --
    88//
    9 // Author           : Richard C. Bilson
     9// Author           : Thierry Delisle
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 19 17:52:03 2018
    13 // Update Count     : 19
     12// Last Modified On : Wed May 16 15:01:23 2018
     13// Update Count     : 30
    1414//
    1515
     
    1717
    1818#include "ErrorObjects.h"
     19#include <cstring>
    1920
    2021//-----------------------------------------------------------------------------
    2122// Errors
     23
     24extern bool SemanticErrorThrow;
    2225
    2326__attribute__((noreturn)) void SemanticError( CodeLocation location, std::string error );
     
    4649        const char * const name;
    4750        const char * const message;
    48         mutable Severity severity;
     51        const Severity default_severity;
    4952};
    5053
    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},
     54constexpr WarningData WarningFormats[] = {
     55        {"self-assign"            , "self assignment of expression: %s"            , Severity::Warn},
     56        {"reference-conversion"   , "rvalue to reference conversion of rvalue: %s" , Severity::Warn},
    5457        {"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn},
    5558};
     
    7174void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
    7275
     76void SemanticWarning_SuppressAll   ();
     77void SemanticWarning_EnableAll     ();
     78void SemanticWarning_WarningAsError();
     79void SemanticWarning_Set           (const char * const name, Severity s);
     80
     81// SKULLDUGGERY: cfa.cc is built before SemanticError.cc but needs this routine.
     82static inline bool SemanticWarning_Exist(const char * const name) {
     83        for ( const auto & w : WarningFormats ) {
     84                if ( std::strcmp( name, w.name ) == 0 ) return true;
     85        }
     86        return false;
     87}
    7388
    7489//-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.