Skip to content

Commit 1922c14

Browse files
committed
Support C++11/C++14 within get_global_typedef
libcpychecker was failing to run for GCC 6 on C++ source files, due to failing to detect the PyObject typedef. Root cause was that the test for u.language == 'GNU C++' was failing; lang_hooks.name defaults to 'GNU C++14' for GCC 6.
1 parent 5f7ea44 commit 1922c14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gccutils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_global_typedef(name):
3737
# Look up a typedef in global scope by name, returning a gcc.TypeDecl,
3838
# or None if not found
3939
for u in gcc.get_translation_units():
40-
if u.language == 'GNU C++':
40+
if u.language.startswith('GNU C++'):
4141
gns = gcc.get_global_namespace()
4242
return gns.lookup(name)
4343
if u.block:

0 commit comments

Comments
 (0)