http://llvm.org/bugs/show_bug.cgi?id=21346

            Bug ID: 21346
           Summary: clang_createIndex - unexpected behavior from
                    excludeDeclarationsFromPCH parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13238
  --> http://llvm.org/bugs/attachment.cgi?id=13238&action=edit
Test program (executor).

Short summary: when clang_createIndex() is called with a zero/"false" argument
for the excludeDeclarationsFromPCH parameter, explicit template instantiations
appear to be missing from the generated AST.

Attached are two files:
 - function_tmpl_instantiation.cc - Reproducer "input" file, consisting of a 
   function template declaration and three explicit instantiations of that
   template.
 - missing_func_decls.cc - Test program. When this program is built without
   -DSHOW_BAD_BEHAVIOR, the CXIndex is created by "clang_createIndex(1, 1)". In
   this case, all function template instantiations are visible when the TU's 
   [top-level] child nodes are all visited. When -DSHOW_BAD_BEHAVIOR is set,
   the CXIndex is created by calling "clang_createIndex(0, 1)". In this case, 
   none of the explicit instantiations are visited when walking the TU's 
   children.

I suspect that this is a bug, b/c the description for the
"excludeDeclarationsFromPCH" parameter only references excluding non-local
declarations from the TU being parsed. I'd expect that the explicit
instantiations would all be considered "local", so the fact that this flag
influences their presence would seem to be a bug.

Apologies in advance if I'm operating under some misconception, & thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to