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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to