[llvm-bugs] [Bug 45173] New: cannot access any object in global module fragment from exported template function

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 11 03:05:47 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45173

            Bug ID: 45173
           Summary: cannot access any object in global module fragment
                    from exported template function
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sw6ueyz at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 23220
  --> https://bugs.llvm.org/attachment.cgi?id=23220&action=edit
source files - build with build.bat or build.sh

// accessing foo ( which is defined in global-module-fragment )
// in an exported-non-template-function succeeded
// but failed in an exported-template-function.

// see attached files and build with build.bat or build.sh


// my_module.cppm

module;

#include "foo.h"   // inline void foo() {}

export module my_module;

export namespace my_module
{
        void bar()
        {
                ::foo();             // OK
        }

        template< class Type >
        void baz()
        {
                ::foo();             // ERROR
        }
}

-- 
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/20200311/ef6dee32/attachment.html>


More information about the llvm-bugs mailing list