GCC v6.1 successfully compiles the code below with flags -std=c++11 -Wall -Wextra -Wpedantic
, but produces this warning:
variable templates only available with -std=c++14 or -std=gnu++14
The code:
#include <iostream>
template <typename T>
struct ParamMetadata {
T min;
T max;
};
template <class T1, class T2>
class FooMap {};
template <typename T>
// WARNING PRODUCED ON THIS LINE
extern FooMap<int, ParamMetadata<T> > metadataHashmap;
int main() {
return 0;
}
If this is a feature only available in C++14, why does it compile with C++11 flag just fine and I can run the executable? Shouldn't it be a fatal error?
Aucun commentaire:
Enregistrer un commentaire