[LLVMbugs] [Bug 15132] New: clang said "address expression must be an lvalue or a function designator"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 31 22:45:45 PST 2013


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

             Bug #: 15132
           Summary: clang said "address expression must be an lvalue or a
                    function designator"
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I wrote something like:

    specific_attr_iterator<AlignedAttr> I = /*...*/;
    if (I->isAlignas()) AlignasAttr = &*I;

and Clang said:

lib/Sema/SemaDeclAttr.cpp:5014:39: error: address expression must be an lvalue
or a function designator
    if (I->isAlignas()) AlignasAttr = &*I;
                                      ^~~

This is possibly the worst diagnostic I've ever seen Clang produce. Why not
something like:

error: cannot take the address of an rvalue of type
'specific_attr_iterator<AlignedAttr>::reference' (aka 'AlignedAttr *')

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