|
From: Luigi B. <lui...@gm...> - 2022-12-02 15:28:25
|
Hello,
hmm, it seems that the example is out of date. There's probably some
discrepancy between the way QuantLib was compiled and the way the example
is. If you run
quantlib-config --cflags --libs
you'll see a few flags that need to be added to your g++ command line.
You're probably missing `-std=c++14` (unfortunately, clang still uses the
pre-C++11 standard as default).
Luigi
On Fri, Dec 2, 2022 at 2:30 PM Brian Smith <bri...@gm...>
wrote:
> Hi,
>
> I have followed the instructions as provided in
> https://www.quantlib.org/install/macosx.shtml to install QL in iMac. All
> worked file, however when I tried to run the example as,
>
> g++ -I/usr/local/include/ -I/usr/local/include/boost BermudanSwaption.cpp \
> -o bermudanswaption -L/usr/local/lib/ -lQuantLib
>
> I get below error
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:21:
> error: exception specification of overriding function is more lax than base
> version const char* what() const noexcept override;
>
> ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:106:25:
> note: overridden virtual function is here virtual const char* what()
> const _NOEXCEPT; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:32:/usr/local/include/ql/errors.hpp:49:33:
> error: expected ';' at end of declaration list const char* what()
> const noexcept override; ^
> ;/usr/local/include/ql/errors.hpp:39:11: error: exception
> specification of overriding function is more lax than base version class
> Error : public std::exception {
> ^/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:105:13:
> note: overridden virtual function is here virtual ~exception()
> _NOEXCEPT; ^In file included from BermudanSwaption.cpp:26:In
> file included from /usr/local/include/ql/instruments/swaption.hpp:32:In
> file included from /usr/local/include/ql/option.hpp:27:In file included
> from /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:In file included from
> /usr/local/include/ql/patterns/observable.hpp:33:/usr/local/include/ql/patterns/singleton.hpp:98:39:
> warning: deleted function definitions are a C++11 extension
> [-Wc++11-extensions] Singleton(const Singleton&) = delete;
>
> ^/usr/local/include/ql/patterns/singleton.hpp:99:28: warning: rvalue
> references are a C++11 extension [-Wc++11-extensions]
> Singleton(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:99:34: warning: deleted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:100:50: warning: deleted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(const Singleton&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:101:39:
> warning: rvalue references are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:101:45: warning:
> deleted function definitions are a C++11 extension [-Wc++11-extensions]
> Singleton& operator=(Singleton&&) = delete;
> ^/usr/local/include/ql/patterns/singleton.hpp:115:23:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Singleton() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:In file included from
> /usr/local/include/ql/patterns/lazyobject.hpp:27:/usr/local/include/ql/patterns/observable.hpp:57:33:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Observable() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:86:32:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] ObservableSettings() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:96:30:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool updatesEnabled_ = true,
> updatesDeferred_ = false;
> ^/usr/local/include/ql/patterns/observable.hpp:96:55: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool updatesEnabled_ = true, updatesDeferred_ =
> false;
> ^/usr/local/include/ql/patterns/observable.hpp:116:22: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> Observer() = default;
> ^/usr/local/include/ql/patterns/observable.hpp:203:20: warning: 'auto'
> type specifier is a C++11 extension [-Wc++11-extensions] for (const
> auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:203:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:208:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:208:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:211:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:211:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:217:20: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const auto&
> observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:217:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:233:24: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] for (const
> auto& observable : o->observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:233:41: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions]
> for (const auto& observable : o->observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:246:20: warning:
> 'auto' type specifier is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^/usr/local/include/ql/patterns/observable.hpp:246:37: warning:
> range-based for loop is a C++11 extension [-Wc++11-extensions] for
> (const auto& observable : observables_)
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:28:/usr/local/include/ql/patterns/lazyobject.hpp:36:24:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] LazyObject() = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:37:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] ~LazyObject()
> override = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:37:34: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> ~LazyObject() override = default;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:40:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void update()
> override;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:34: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:51: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^/usr/local/include/ql/patterns/lazyobject.hpp:109:75: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool calculated_ = false, frozen_ =
> false, alwaysForward_ = false;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:29:/usr/local/include/ql/pricingengine.hpp:38:26:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~PricingEngine() override = default;
> ^/usr/local/include/ql/pricingengine.hpp:38:37: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> ~PricingEngine() override = default;
> ^/usr/local/include/ql/pricingengine.hpp:47:32: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] virtual
> ~arguments() = default;
> ^/usr/local/include/ql/pricingengine.hpp:53:30: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> virtual ~results() = default;
> ^/usr/local/include/ql/pricingengine.hpp:66:56: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions]
> PricingEngine::arguments* getArguments() const override { return
> &arguments_; }
> ^/usr/local/include/ql/pricingengine.hpp:67:58: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] const
> PricingEngine::results* getResults() const override { return &results_; }
>
> ^/usr/local/include/ql/pricingengine.hpp:68:22: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void reset()
> override { results_.reset(); }
> ^/usr/local/include/ql/pricingengine.hpp:69:23: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void update()
> override { notifyObservers(); } ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:30:/usr/local/include/ql/utilities/null.hpp:43:13:
> error: unknown type name 'constexpr' constexpr static float
> nullValue() { ^/usr/local/include/ql/utilities/null.hpp:52:13:
> error: unknown type name 'constexpr' constexpr static int
> nullValue() { ^/usr/local/include/ql/utilities/null.hpp:78:18:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Null() = default; ^In file
> included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:31:In file included from
> /usr/local/include/ql/time/date.hpp:34:/usr/local/include/ql/time/period.hpp:46:20:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Period() = default;
> ^/usr/local/include/ql/time/period.hpp:60:25: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Integer length_ = 0;
> ^/usr/local/include/ql/time/period.hpp:61:25: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] TimeUnit units_ = Days;
> ^/usr/local/include/ql/time/period.hpp:148:16: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] return
> {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:148:16: error:
> non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: warning:
> generalized initializer lists are a C++11 extension [-Wc++11-extensions]
> return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:153:16: error:
> non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list return {Integer(n), units};
> ^~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55: warning:
> generalized initializer lists are a C++11 extension [-Wc++11-extensions]
> inline Period operator-(const Period& p) { return {-p.length(), p.units()};
> }
> ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:156:55:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator-(const Period& p) { return
> {-p.length(), p.units()}; }
> ^~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66:
> warning: generalized initializer lists are a C++11 extension
> [-Wc++11-extensions] inline Period operator*(Integer n, const Period& p)
> { return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:158:66:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator*(Integer n, const Period& p) {
> return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66:
> warning: generalized initializer lists are a C++11 extension
> [-Wc++11-extensions] inline Period operator*(const Period& p, Integer n)
> { return {n * p.length(), p.units()}; }
>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/period.hpp:160:66:
> error: non-aggregate type 'QuantLib::Period' cannot be initialized with an
> initializer list inline Period operator*(const Period& p, Integer n) {
> return {n * p.length(), p.units()}; }
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:In file included from
> /usr/local/include/ql/instrument.hpp:31:/usr/local/include/ql/time/date.hpp:386:18:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Null() = default;
> ^/usr/local/include/ql/time/date.hpp:387:40: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions]
> operator Date() const { return {}; }
> ^~/usr/local/include/ql/time/date.hpp:387:40: error: non-aggregate type
> 'QuantLib::Date' cannot be initialized with an initializer list
> operator Date() const { return {}; }
> ^~/usr/local/include/ql/time/date.hpp:431:16: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] return
> {monthLength(m, isLeap(y)), m, y};
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/local/include/ql/time/date.hpp:431:16:
> error: non-aggregate type 'QuantLib::Date' cannot be initialized with an
> initializer list return {monthLength(m, isLeap(y)), m, y};
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:88:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void calculate() const override;
> ^/usr/local/include/ql/instrument.hpp:99:42: warning: 'override' keyword
> is a C++11 extension [-Wc++11-extensions] void performCalculations()
> const override;
> ^/usr/local/include/ql/instrument.hpp:115:22: warning: 'override' keyword
> is a C++11 extension [-Wc++11-extensions] void reset() override {
> ^/usr/local/include/ql/instrument.hpp:113:23: error:
> exception specification of overriding function is more lax than base
> version class Instrument::results : public virtual
> PricingEngine::results {
> ^/usr/local/include/ql/pricingengine.hpp:53:17: note: overridden virtual
> function is here virtual ~results() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:In file included from
> /usr/local/include/ql/option.hpp:27:/usr/local/include/ql/instrument.hpp:174:15:
> warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
> const auto* results = dynamic_cast<const Instrument::results*>(r);
> ^In file included from BermudanSwaption.cpp:26:In file included
> from
> /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:44:62:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/option.hpp:59:23: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] arguments() =
> default; ^/usr/local/include/ql/option.hpp:60:31:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void validate() const override {
> ^/usr/local/include/ql/option.hpp:57:19: error: exception specification of
> overriding function is more lax than base version class
> Option::arguments : public virtual PricingEngine::arguments {
> ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden
> virtual function is here virtual ~arguments() = default;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:32:/usr/local/include/ql/option.hpp:71:22:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void reset() override { delta = gamma = theta = vega = rho = dividendRho
> = Null<Real>(); }
> ^/usr/local/include/ql/option.hpp:81:22: warning: 'override' keyword is a
> C++11 extension [-Wc++11-extensions] void reset() override {
> ^/usr/local/include/ql/option.hpp:93:9: warning: 'auto' type
> specifier is a C++11 extension [-Wc++11-extensions] auto* arguments
> = dynamic_cast<Option::arguments*>(args); ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from
> /usr/local/include/ql/instruments/swap.hpp:30:In file included from
> /usr/local/include/ql/cashflow.hpp:28:/usr/local/include/ql/event.hpp:42:18:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~Event() override = default;
> ^/usr/local/include/ql/event.hpp:42:29: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~Event()
> override = default;
> ^/usr/local/include/ql/event.hpp:72:31: warning: 'override' keyword is a
> C++11 extension [-Wc++11-extensions] Date date() const override
> { return date_; } ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file included from
> /usr/local/include/ql/instruments/swap.hpp:30:In file included from
> /usr/local/include/ql/cashflow.hpp:29:/usr/local/include/ql/math/comparison.hpp:69:9:
> error: unknown type name 'constexpr' constexpr double tolerance = 42
> * QL_EPSILON; ^/usr/local/include/ql/math/comparison.hpp:100:9:
> error: unknown type name 'constexpr' constexpr double tolerance = 42
> * QL_EPSILON; ^In file included from BermudanSwaption.cpp:26:In file
> included from /usr/local/include/ql/instruments/swaption.hpp:33:In file
> included from /usr/local/include/ql/instruments/vanillaswap.hpp:29:In file
> included from
> /usr/local/include/ql/instruments/swap.hpp:30:/usr/local/include/ql/cashflow.hpp:40:21:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~CashFlow() override = default;
> ^/usr/local/include/ql/cashflow.hpp:40:32: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~CashFlow()
> override = default;
> ^/usr/local/include/ql/cashflow.hpp:44:27: warning: 'override' keyword is
> a C++11 extension [-Wc++11-extensions] Date date() const override =
> 0; ^/usr/local/include/ql/cashflow.hpp:50:84:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> boost::optional<bool> includeRefDate = boost::none)
> const override;
> ^/usr/local/include/ql/cashflow.hpp:67:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> accept(AcyclicVisitor&) override;
> ^/usr/local/include/ql/cashflow.hpp:60:52: warning: generalized
> initializer lists are a C++11 extension [-Wc++11-extensions] virtual
> Date exCouponDate() const { return {}; };
> ^~/usr/local/include/ql/cashflow.hpp:60:52: error:
> non-aggregate type 'QuantLib::Date' cannot be initialized with an
> initializer list virtual Date exCouponDate() const { return {}; };
> ^~In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:68:27:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void deepUpdate() override;
> ^/usr/local/include/ql/instruments/swap.hpp:72:32: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool isExpired()
> const override;
> ^/usr/local/include/ql/instruments/swap.hpp:73:62: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/instruments/swap.hpp:74:64: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> fetchResults(const PricingEngine::results*) const override;
>
> ^/usr/local/include/ql/instruments/swap.hpp:129:35: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupExpired() const override;
> ^/usr/local/include/ql/instruments/swap.hpp:145:31: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void validate()
> const override;
> ^/usr/local/include/ql/instruments/swap.hpp:141:17: error: exception
> specification of overriding function is more lax than base version class
> Swap::arguments : public virtual PricingEngine::arguments {
> ^/usr/local/include/ql/pricingengine.hpp:47:17: note: overridden virtual
> function is here virtual ~arguments() = default; ^In
> file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:29:/usr/local/include/ql/instruments/swap.hpp:154:22:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void reset() override; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:30:/usr/local/include/ql/time/daycounter.hpp:49:31:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Impl() = default;
> ^/usr/local/include/ql/time/daycounter.hpp:72:24: warning:
> defaulted function definitions are a C++11 extension [-Wc++11-extensions]
> DayCounter() = default; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from
> /usr/local/include/ql/time/schedule.hpp:29:In file included from
> /usr/local/include/ql/time/calendars/nullcalendar.hpp:28:/usr/local/include/ql/time/calendar.hpp:66:31:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Impl() = default;
> ^/usr/local/include/ql/time/calendar.hpp:78:22: warning:
> defaulted function definitions are a C++11 extension [-Wc++11-extensions]
> Calendar() = default;
> ^/usr/local/include/ql/time/calendar.hpp:170:43: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool
> isWeekend(Weekday) const override;
> ^/usr/local/include/ql/time/calendar.hpp:181:43: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] bool
> isWeekend(Weekday) const override;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:In file included from
> /usr/local/include/ql/time/schedule.hpp:29:/usr/local/include/ql/time/calendars/nullcalendar.hpp:42:38:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return "Null"; }
>
> ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:43:43: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isWeekend(Weekday) const override { return false; }
>
> ^/usr/local/include/ql/time/calendars/nullcalendar.hpp:44:51: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isBusinessDay(const Date&) const override { return true; }
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:In file included from
> /usr/local/include/ql/instruments/vanillaswap.hpp:31:/usr/local/include/ql/time/schedule.hpp:66:22:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Schedule() = default;
> ^/usr/local/include/ql/time/schedule.hpp:148:36: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] DateGeneration::Rule rule_ =
> DateGeneration::Backward;
> ^/usr/local/include/ql/time/schedule.hpp:149:26: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool endOfMonth_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:33:/usr/local/include/ql/instruments/vanillaswap.hpp:112:67:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void setupArguments(PricingEngine::arguments* args) const override;
>
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:113:64: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> fetchResults(const PricingEngine::results*) const override;
>
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:116:35: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> setupExpired() const override;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:137:19: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Type type = Receiver;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:150:31: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> validate() const override;
> ^/usr/local/include/ql/instruments/vanillaswap.hpp:158:22: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions] void
> reset() override; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:29:/usr/local/include/ql/settings.hpp:113:42:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool includeReferenceDateEvents_ =
> false;
> ^/usr/local/include/ql/settings.hpp:115:45: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool enforcesTodaysHistoricFixings_ = false;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:30:/usr/local/include/ql/handle.hpp:51:27:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override { notifyObservers(); }
> ^/usr/local/include/ql/handle.hpp:55:30: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool isObserver_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file included
> from /usr/local/include/ql/instruments/swaption.hpp:34:In file included
> from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:In file
> included from
> /usr/local/include/ql/termstructure.hpp:31:/usr/local/include/ql/math/interpolations/extrapolation.hpp:34:26:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] Extrapolator() = default;
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:35:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] virtual ~Extrapolator() = default;
>
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:49:27:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] bool extrapolate_ = false;
> ^In file included from BermudanSwaption.cpp:26:In file
> included from /usr/local/include/ql/instruments/swaption.hpp:34:In file
> included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:26:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~TermStructure() override = default;
> ^/usr/local/include/ql/termstructure.hpp:75:9: error: exception
> specification of overriding function is more lax than base version
> ~TermStructure() override = default;
> ^/usr/local/include/ql/math/interpolations/extrapolation.hpp:35:17: note:
> overridden virtual function is here virtual ~Extrapolator() =
> default; ^In file included from BermudanSwaption.cpp:26:In
> file included from /usr/local/include/ql/instruments/swaption.hpp:34:In
> file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:29:/usr/local/include/ql/termstructure.hpp:75:37:
> warning: defaulted function definitions are a C++11 extension
> [-Wc++11-extensions] ~TermStructure() override = default;
> ^/usr/local/include/ql/termstructure.hpp:95:23:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override;
> ^/usr/local/include/ql/termstructure.hpp:104:22: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] bool moving_ = false;
> ^/usr/local/include/ql/termstructure.hpp:105:31: warning: default member
> initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] mutable bool updated_ = true;
> ^In file included from BermudanSwaption.cpp:26:In file included
> from /usr/local/include/ql/instruments/swaption.hpp:34:In file included
> from /usr/local/include/ql/termstructures/yieldtermstructure.hpp:30:In file
> included from
> /usr/local/include/ql/interestrate.hpp:28:/usr/local/include/ql/time/daycounters/actual365fixed.hpp:54:38:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return std::string("Actual/365
> (Fixed)"); }
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:56:90: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> yearFraction(const Date& d1, const Date& d2, const Date&, const Date&)
> const override {
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:62:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override {
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:68:63: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> const Date& refPeriodEnd) const override;
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:72:38: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> std::string name() const override { return std::string("Actual/365 (No
> Leap)"); }
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:73:78: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> Date::serial_type dayCount(const Date& d1, const Date& d2) const override;
>
> ^/usr/local/include/ql/time/daycounters/actual365fixed.hpp:77:63: warning:
> 'override' keyword is a C++11 extension [-Wc++11-extensions]
> const Date& refPeriodEnd) const override;
> ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:In file included from
> /usr/local/include/ql/termstructures/yieldtermstructure.hpp:31:/usr/local/include/ql/quote.hpp:39:18:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> ~Quote() override = default;
> ^/usr/local/include/ql/quote.hpp:39:29: warning: defaulted function
> definitions are a C++11 extension [-Wc++11-extensions] ~Quote()
> override = default; ^In file included from
> BermudanSwaption.cpp:26:In file included from
> /usr/local/include/ql/instruments/swaption.hpp:34:/usr/local/include/ql/termstructures/yieldtermstructure.hpp:155:23:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void update() override;
> ^/usr/local/include/ql/termstructures/yieldtermstructure.hpp:176:22:
> warning: default member initializer for non-static data member is a C++11
> extension [-Wc++11-extensions] Size nJumps_ = 0;
> ^In file included from
> BermudanSwaption.cpp:26:/usr/local/include/ql/instruments/swaption.hpp:91:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> bool isExpired() const override;
> ^/usr/local/include/ql/instruments/swaption.hpp:92:62: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void
> setupArguments(PricingEngine::arguments*) const override;
>
> ^/usr/local/include/ql/instruments/swaption.hpp:128:23: warning: defaulted
> function definitions are a C++11 extension [-Wc++11-extensions]
> arguments() = default;
> ^/usr/local/include/ql/instruments/swaption.hpp:130:41: warning: default
> member initializer for non-static data member is a C++11 extension
> [-Wc++11-extensions] Settlement::Type settlementType =
> Settlement::Physical;
> ^/usr/local/include/ql/instruments/swaption.hpp:132:31: warning: 'override'
> keyword is a C++11 extension [-Wc++11-extensions] void validate()
> const override; ^In file included from
> BermudanSwaption.cpp:27:/usr/local/include/ql/pricingengines/swap/discountingswapengine.hpp:41:32:
> warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
> void calculate() const override; ^In file
> included from BermudanSwaption.cpp:28:In file included from
> /usr/local/include/ql/pricingengines/swaption/treeswaptionengine.hpp:29:In
> file included from
> /usr/local/include/ql/pricingengines/latticeshortratemodelengine.hpp:28:In
> file included from /usr/local/include/ql/models/model.hpp:30:In file
> included from /usr/local/include/ql/methods/lattices/lattice.hpp:28:In file
> included from
> /usr/local/include/ql/numericalmethod.hpp:28:/usr/local/include/ql/math/array.hpp:67:20:
> warning: rvalue references are a C++11 extension [-Wc++11-extensions]
> Array(Array&&) noexcept; ^fatal error: too many errors
> emitted, stopping now [-ferror-limit=]125 warnings and 20 errors generated.*
>
> Could you please suggest how to resolve this error?
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|