Fix clang complaining about control reaching end of non-void function

This commit is contained in:
Paul Romano 2018-09-12 22:39:27 -05:00
parent 74b7e53bbb
commit ce04299f30
10 changed files with 49 additions and 24 deletions

View file

@ -29,6 +29,7 @@ bool is_fission(int MT);
class Function1D {
public:
virtual double operator()(double x) const = 0;
virtual ~Function1D() = default;
};
//==============================================================================

View file

@ -1,7 +1,8 @@
#ifndef OPENMC_POSITION_H
#define OPENMC_POSITION_H
#include <cmath>
#include <cmath> // for sqrt
#include <stdexcept> // for out_of_range
#include <vector>
namespace openmc {
@ -29,6 +30,8 @@ struct Position {
case 0: return x;
case 1: return y;
case 2: return z;
default:
throw std::out_of_range{"Index in Position must be between 0 and 2."};
}
}
double& operator[](int i) {
@ -36,6 +39,8 @@ struct Position {
case 0: return x;
case 1: return y;
case 2: return z;
default:
throw std::out_of_range{"Index in Position must be between 0 and 2."};
}
}