[LLVMbugs] [Bug 12128] New: Should odr-use of a template function odr-use the template arguments?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 28 21:23:03 PST 2012


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

             Bug #: 12128
           Summary: Should odr-use of a template function odr-use the
                    template arguments?
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    richard-llvm at metafoo.co.uk
    Classification: Unclassified


Basically, the idea is, is the following testcase valid?

template<typename T> T f() { return; }
template<int (*F)()> void g() { }
void g() { g<f<int>>(); }

With my semi-recent changes, we don't try to instantiate f<int>; given that we
don't need the definition for IRGen, are we required to instantiate it?  If we
are required to instantiate, is it because g<f<int>> is odr-used, or some other
reason?

It's sort of a silly edge case, given that as far as I can tell, this won't
ever cause us to reject valid code, but I figured it was worth clarifying the
rules here.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list