[LLVMbugs] [Bug 6781] New: Template diagnostics should suppress instantiation contexts when there are lots

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 5 09:36:48 PDT 2010


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

           Summary: Template diagnostics should suppress instantiation
                    contexts when there are lots
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


This testcase:

template <int N> struct X {
    static const int value = X<N-1>::value;
};
template struct X<1000>;

compiles to this with gcc:

testsuite/9335.cc:2:38: error: template instantiation depth exceeds maximum of
1024 (use -ftemplate-depth= to increase the maximum) instantiating ‘struct
X<-0x00000000000000018>’
testsuite/9335.cc:2:38:   instantiated from ‘const int
X<-0x00000000000000017>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int
X<-0x00000000000000016>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int
X<-0x00000000000000015>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int
X<-0x00000000000000014>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int
X<-0x00000000000000013>::value’
testsuite/9335.cc:2:38:   [ skipping 1014 instantiation contexts ]
testsuite/9335.cc:2:38:   instantiated from ‘const int X<996>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int X<997>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int X<998>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int X<999>::value’
testsuite/9335.cc:2:38:   instantiated from ‘const int X<1000>::value’
testsuite/9335.cc:4:17:   instantiated from here

Clang emits all of those instantiation contexts, which is not helpful.

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