summaryrefslogtreecommitdiff
path: root/tools/conf_tests/allows_static_inline_npos.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/conf_tests/allows_static_inline_npos.cc')
-rw-r--r--tools/conf_tests/allows_static_inline_npos.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/conf_tests/allows_static_inline_npos.cc b/tools/conf_tests/allows_static_inline_npos.cc
new file mode 100644
index 00000000..ac11b5d4
--- /dev/null
+++ b/tools/conf_tests/allows_static_inline_npos.cc
@@ -0,0 +1,21 @@
+// Configuration-time test program, used in Meson build.
+// Check whether a static member variable may be initialized inline to std::string::npos.
+// The MipsPro (IRIX) compiler does not like this.
+// Corresponds to the M4 macro GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS.
+
+#include <string>
+#include <iostream>
+
+class ustringtest
+{
+public:
+ // The MipsPro compiler (IRIX) says "The indicated constant value is not known",
+ // so we need to initialize the static member data elsewhere.
+ static const std::string::size_type ustringnpos = std::string::npos;
+};
+
+int main()
+{
+ std::cout << "npos=" << ustringtest::ustringnpos << std::endl;
+ return 0;
+}