[LLVMbugs] [Bug 12702] New: Assertion failure when using local class as template parameter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 29 22:36:44 PDT 2012


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

             Bug #: 12702
           Summary: Assertion failure when using local class as template
                    parameter
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zeratul976 at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following code:

struct S
{
    template <typename F>
    bool apply(F f)
    {
        return f();
    }
};

template <typename>
struct T
{
    void foo()
    {
        struct F
        {
            int x;

            bool operator()()
            {
                return x == 0;
            }
        };

        S().apply(F());
    }
};

int main()                  
{                           
    T<int>().foo();
}

triggers the following assertion failure:

llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2560:
llvm::PointerUnion<clang::Decl*, llvm::SmallVector<clang::Decl*, 4u>*>*
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.

-- 
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