Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    rb1f2007d rbe00a2d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 11 21:54:22 2023
    13 // Update Count     : 54
     12// Last Modified On : Sat Feb 25 12:01:31 2023
     13// Update Count     : 37
    1414//
    1515
     
    1818#include "ErrorObjects.h"
    1919#include "AST/Node.hpp"
    20 #include "AST/ParseNode.hpp"
    2120#include <cstring>
    2221
     
    2625extern bool SemanticErrorThrow;
    2726
    28 __attribute__((noreturn, format(printf, 2, 3))) void SemanticError( CodeLocation location, const char fmt[], ... );
    29 
    3027__attribute__((noreturn)) void SemanticError( CodeLocation location, std::string error );
    3128
    32 __attribute__((noreturn)) static inline void SemanticError( const ast::ParseNode * obj, const std::string & error ) {
     29template< typename T >
     30__attribute__((noreturn)) static inline void SemanticError( const T * obj, const std::string & error ) {
    3331        SemanticError( obj->location, toString( error, obj ) );
    3432}
    3533
    36 __attribute__((noreturn)) static inline void SemanticError( CodeLocation location, const ast::Node * obj, const std::string & error ) {
     34template< typename T >
     35__attribute__((noreturn)) static inline void SemanticError( CodeLocation location, const T * obj, const std::string & error ) {
    3736        SemanticError( location, toString( error, obj ) );
    3837}
     
    5554
    5655constexpr WarningData WarningFormats[] = {
    57         {"self-assign"              , Severity::Warn, "self assignment of expression: %s"                          },
    58         {"reference-conversion"     , Severity::Warn, "rvalue to reference conversion of rvalue: %s"               },
    59         {"qualifiers-zero_t-one_t"  , Severity::Warn, "questionable use of type qualifier(s) with %s"              },
    60         {"aggregate-forward-decl"   , Severity::Warn, "forward declaration of nested aggregate: %s"                },
    61         {"superfluous-decl"         , Severity::Warn, "declaration does not allocate storage: %s"                  },
    62         {"superfluous-else"         , Severity::Warn, "else clause never executed for empty loop conditional"      },
    63         {"gcc-attributes"           , Severity::Warn, "invalid attribute: %s"                                      },
    64         {"c++-like-copy"            , Severity::Warn, "Constructor from reference is not a valid copy constructor" },
    65         {"depreciated-trait-syntax" , Severity::Warn, "trait type-parameters are now specified using the forall clause" },
     56        {"self-assign"              , Severity::Warn    , "self assignment of expression: %s"                          },
     57        {"reference-conversion"     , Severity::Warn    , "rvalue to reference conversion of rvalue: %s"               },
     58        {"qualifiers-zero_t-one_t"  , Severity::Warn    , "questionable use of type qualifier(s) with %s"              },
     59        {"aggregate-forward-decl"   , Severity::Warn    , "forward declaration of nested aggregate: %s"                },
     60        {"superfluous-decl"         , Severity::Warn    , "declaration does not allocate storage: %s"                  },
     61        {"superfluous-else"         , Severity::Warn    , "else clause never executed for empty loop conditional"      },
     62        {"gcc-attributes"           , Severity::Warn    , "invalid attribute: %s"                                      },
     63        {"c++-like-copy"            , Severity::Warn    , "Constructor from reference is not a valid copy constructor" },
     64        {"depreciated-trait-syntax" , Severity::Warn    , "trait type-parameters are now specified using the forall clause" },
    6665};
    6766
     
    7675        CppCopy,
    7776        DeprecTraitSyntax,
    78         NUMBER_OF_WARNINGS, // MUST be the last warning
     77        NUMBER_OF_WARNINGS, // This MUST be the last warning
    7978};
    8079
Note: See TracChangeset for help on using the changeset viewer.