[LLVMbugs] [Bug 19277] New: if two sibling modules declare the same entity, loading decl from one entity does not always load from the other

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 28 11:18:21 PDT 2014


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

            Bug ID: 19277
           Summary: if two sibling modules declare the same entity,
                    loading decl from one entity does not always load from
                    the other
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testcase:

$ for i in *; do echo $i; cat -n $i; done
a.h
     1  namespace N {
     2    struct X;
     3    extern X x;
     4  }
b.h
     1  namespace N {
     2    struct X { int n; };
     3  }
c.cc
     1  #include "a.h"
     2  #include "b.h"
     3  
     4  int k = N::x.n;
module.map
     1  module a { header "a.h" } module b { header "b.h" }
$ clang -fmodules -fcxx-modules c.cc -I.
c.cc:4:13: error: member access into incomplete type 'N::X'
int k = N::x.n;
            ^
./a.h:2:10: note: forward declaration of 'N::X'
  struct X;
         ^
1 error generated.


The problem is that nothing in c.cc causes us to load N::X from module b.

For top-level declarations, loading the forward declaration causes us to load
the identifier, which causes us to load all declarations of that identifier,
but that just makes the problem slightly harder to reproduce (you need to
trigger the loading of the forward declaration between the import of module a
and the import of module b).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140328/779b365c/attachment.html>


More information about the llvm-bugs mailing list