[LLVMbugs] [Bug 7675] [C++ Analyzer] Assertion `(isa<RecordType>(Ex->getType().getDesugaredType()) || isa<ArrayType>(Ex->getType().getDesugaredType())) && "Other kinds of expressions with non-aggregate/union/class types" " do not have lvalues."' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 28 18:32:35 PDT 2010


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

Ted Kremenek <kremenek at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Ted Kremenek <kremenek at apple.com> 2010-07-28 20:32:34 CDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > I can only guess, but it seems that in the switch in function
> > GRExprEngine::VisitLValue Stmt::FloatingLiteralClass in unhandled.
> > 
> > Index: lib/Checker/GRExprEngine.cpp
> > ===================================================================
> > --- lib/Checker/GRExprEngine.cpp        (revision 109275)
> > +++ lib/Checker/GRExprEngine.cpp        (working copy)
> > @@ -1058,6 +1058,7 @@
> >      // In C++, binding an rvalue to a reference requires to create an object.
> >      case Stmt::CXXBoolLiteralExprClass:
> >      case Stmt::IntegerLiteralClass:
> > +    case Stmt::FloatingLiteralClass:
> >        CreateCXXTemporaryObject(Ex, Pred, Dst);
> >        return;
> > 
> > 
> > I am unable to compile clang now, so I can't test it. But changing floats to
> > ints in reduced test case causes clang to not crash.
> 
> Sorry for the spamming, but of course there can be other *LiteralClass that
> need to be handled in the same way, I am not sure if I found all of them:
> FloatingLiteralClass
> CharacterLiteralClass
> ImaginaryLiteral (?)

Yes, all of these cases need to be handled.

Fixed here:

http://llvm.org/viewvc/llvm-project?view=rev&revision=109719

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