Changes in src/Common/SemanticError.h [9dc31c10:6d2aa7ed]
- File:
-
- 1 edited
-
src/Common/SemanticError.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.h
r9dc31c10 r6d2aa7ed 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 18 16:28:16 201813 // Update Count : 1 812 // Last Modified On : Tue Aug 29 22:03:36 2017 13 // Update Count : 17 14 14 // 15 15 … … 36 36 // Warnings 37 37 38 constexpr const char * const WarningFormats[] = { 39 "self assignment of expression: %s", 40 "rvalue to reference conversion of rvalue: %s", 41 "questionable use of type qualifier %s with %s", 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}, 42 54 }; 43 55 … … 45 57 SelfAssignment, 46 58 RvalueToReferenceConversion, 47 BadQualifiersZeroOne,48 59 NUMBER_OF_WARNINGS, //This MUST be the last warning 49 60 }; … … 54 65 ); 55 66 56 // ## used here to allow empty __VA_ARGS__ 57 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id], ## __VA_ARGS__) 67 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__) 58 68 59 69 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
Note:
See TracChangeset
for help on using the changeset viewer.