diff --git a/CppHeaderParser/CppHeaderParser.py b/CppHeaderParser/CppHeaderParser.py index f142278..0d6b76c 100644 --- a/CppHeaderParser/CppHeaderParser.py +++ b/CppHeaderParser/CppHeaderParser.py @@ -111,7 +111,6 @@ def debug_print(fmt, *args): args = (inspect.currentframe().f_back.f_lineno,) + args print(fmt % args) - else: debug_caller_lineno = None @@ -128,7 +127,6 @@ def trace_print(*args): sys.stdout.write(" %s" % a) sys.stdout.write("\n") - else: def trace_print(*args): @@ -1470,7 +1468,7 @@ class Resolver(object): C_MODIFIERS = "* & const constexpr static mutable".split() C_MODIFIERS = set(C_MODIFIERS) - C_KEYWORDS = "extern virtual static explicit inline friend".split() + C_KEYWORDS = "extern virtual static explicit inline friend constexpr".split() C_KEYWORDS = set(C_KEYWORDS) SubTypedefs = {} # TODO deprecate? diff --git a/test/test_CppHeaderParser.py b/test/test_CppHeaderParser.py index c454a32..374658c 100644 --- a/test/test_CppHeaderParser.py +++ b/test/test_CppHeaderParser.py @@ -2999,6 +2999,21 @@ def test_fn(self): self.assertEqual(p["defaultValue"], "0.02") +class ConstExprFn_TestCase(unittest.TestCase): + def setUp(self): + self.cppHeader = CppHeaderParser.CppHeader( + """ +constexpr int overloaded_constexpr(int a, int b, int c) { return a + b + c; } +""", + "string", + ) + + def test_fn(self): + m = self.cppHeader.functions[0] + self.assertEqual(m["constexpr"], True) + self.assertEqual(m["rtnType"], "int") + + class DefaultEnum_TestCase(unittest.TestCase): def setUp(self): self.cppHeader = CppHeaderParser.CppHeader(
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: