ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since 02cea2d was
3906301,
checked in by Rob Schluntz <rschlunt@…>, 8 years ago
|
change constructor warnings into errors and update the test output
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[51587aa] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
[3906301] | 7 | // SemanticError.h -- |
---|
[51587aa] | 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Mon May 18 07:44:20 2015 |
---|
[01aeade] | 11 | // Last Modified By : Peter A. Buhr |
---|
[5f2f2d7] | 12 | // Last Modified On : Mon Jun 8 14:38:53 2015 |
---|
| 13 | // Update Count : 4 |
---|
[51587aa] | 14 | // |
---|
[51b7345] | 15 | |
---|
| 16 | #ifndef SEMANTICERROR_H |
---|
| 17 | #define SEMANTICERROR_H |
---|
| 18 | |
---|
| 19 | #include <exception> |
---|
| 20 | #include <string> |
---|
[5f2f2d7] | 21 | #include <sstream> |
---|
[51b7345] | 22 | #include <list> |
---|
| 23 | #include <iostream> |
---|
| 24 | |
---|
[01aeade] | 25 | class SemanticError : public std::exception { |
---|
| 26 | public: |
---|
| 27 | SemanticError(); |
---|
| 28 | SemanticError( std::string error ); |
---|
| 29 | template< typename T > SemanticError( const std::string &error, const T *obj ); |
---|
| 30 | ~SemanticError() throw() {} |
---|
| 31 | |
---|
| 32 | void append( SemanticError &other ); |
---|
[3906301] | 33 | void append( const std::string & ); |
---|
[01aeade] | 34 | bool isEmpty() const; |
---|
| 35 | void print( std::ostream &os ); |
---|
| 36 | |
---|
| 37 | // constructs an exception using the given message and the printed |
---|
| 38 | // representation of the obj (T must have a print method) |
---|
| 39 | private: |
---|
| 40 | std::list< std::string > errors; |
---|
[51b7345] | 41 | }; |
---|
| 42 | |
---|
| 43 | template< typename T > |
---|
[01aeade] | 44 | SemanticError::SemanticError( const std::string &error, const T *obj ) { |
---|
[3906301] | 45 | append( toString( error, obj ) ); |
---|
[51b7345] | 46 | } |
---|
| 47 | |
---|
[3906301] | 48 | |
---|
[01aeade] | 49 | #endif // SEMANTICERROR_H |
---|
| 50 | |
---|
[51587aa] | 51 | // Local Variables: // |
---|
| 52 | // tab-width: 4 // |
---|
| 53 | // mode: c++ // |
---|
| 54 | // compile-command: "make install" // |
---|
| 55 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.