[LLVMbugs] [Bug 16936] New: C++ template instantiation bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 19 14:42:55 PDT 2013


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

            Bug ID: 16936
           Summary: C++ template instantiation bug
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gentryx at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11069
  --> http://llvm.org/bugs/attachment.cgi?id=11069&action=edit
test program which exhibits the bug when compiled with clang++, but not when
using g++ or icpc

Dear clang developers,

I was investigating whether our computer simulation library
LibGeoDecomp would work with clang++, when I noticed that some of the
unit tests were failing. Apparently clang++ handles partial
specialization of member function templates in combination with
inheritance differently from other compilers (e.g. g++ and icpc).

I've tried to come up with a minimal test program which reproduces the
odd behavior (attached). Having been pruned so much, the program
itself doesn't make much sense. It was originally part of our code
which handles boundary conditions. IMHO the program should yield the
output "function2" twice, but with clang++ I get "function5" for the
first invocation. Is this a bug in clang++, or is this simply
undefined behavior?

Reproduction:
-------------

icpc test3.cpp -o test && ./test && echo "-------------------------" &&  g++
test3.cpp -o test && ./test && echo "------------" && clang++ test3.cpp -o test
&& ./test

Output:
-------

function2
function2
-------------------------
function2
function2
------------
function5
function2

Thanks!
-Andreas

-- 
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/20130819/268264c2/attachment.html>


More information about the llvm-bugs mailing list