[LLVMbugs] [Bug 6988] New: Calling template function makes assertion "!asLValue" fail

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 30 05:44:16 PDT 2010


           Summary: Calling template function makes assertion "!asLValue"
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: magnus.reftel at gmail.com
                CC: llvmbugs at cs.uiuc.edu

The following small testcase makes the static analyzer crash


template<typename T> void foo(const T&);

void Fail()
        int i;


The error message the analyzer prints is


/opt/llvm-r102704/bin/clang++ --analyze testcase.cpp
assertion "!asLValue" failed: file "GRExprEngine.cpp", line 2749, function:
void clang::GRExprEngine::VisitUnaryOperator(clang::UnaryOperator*,
clang::ExplodedNode*, clang::ExplodedNodeSet&, bool)
Stack dump:
0.      Program arguments: /opt/llvm-r102704/bin/clang -cc1 -triple
i386-pc-cygwin -analyze -disable-free -main-file-name testcase.cpp
-analyzer-store=region -analyzer-opt-analyze-nested-blocks
-analyzer-check-dead-stores -analyzer-check-objc-mem -analyzer-eagerly-assume
-analyzer-check-objc-methodsigs -analyzer-check-objc-unused-ivars
-analyzer-output plist -w -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -target-cpu pentium4 -resource-dir
/opt/llvm-r102704/lib/clang/2.0 -ferror-limit 19 -ftemplate-backtrace-limit 10
-fmessage-length 80 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o testcase.plist -x c++ testcase.cpp
1.      <eof> parser at end of file
2.      testcase.cpp:6:2: Error evaluating statement
3.      testcase.cpp:6:2: Error evaluating statement
4.      testcase.cpp:6:6: Error evaluating statement
clang: error: analyzer command failed due to signal 6 (use -v to see


I've tested with various versions from r98628 to r102704. They all have the
same behavior.

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