#include "namespace.h"
#include <map>
#include <string>
+#include <string.h>
static struct block_symbol
cp_lookup_nested_symbol_1 (struct type *container_type,
/* Note: We can't do a simple assert for ':' not being in NAME because
':' may be in the args of a template spec. This isn't intended to be
a complete test, just cheap and documentary. */
- if (strchr (name, '<') == NULL && strchr (name, '(') == NULL)
- gdb_assert (strstr (name, "::") == NULL);
+ gdb_assert (strpbrk ("<>()", name) != nullptr
+ || strstr (name, "::") == nullptr);
sym = lookup_symbol_in_static_block (name, block, domain);
if (sym.symbol != NULL)
# Regression tests for PR 9496.
gdb_test "whatis ::C::CClass::NestedClass" "type = C::CClass::NestedClass"
gdb_test "whatis ::C::CClass::NestedClass *" "type = C::CClass::NestedClass \\*"
+
+# Break on functions with a malformed name.
+gdb_test "break DNE>::DNE" "" "br malformed \'>\'" \
+ "Make breakpoint pending on future shared library load?.*" "y"
+gdb_test "break DNE)::DNE" "" "br malformed \')\'" \
+ "Make breakpoint pending on future shared library load?.*" "y"