Bug 13989 - C++ method lookup fails for methods returning vector types (because of attribute)
Summary: C++ method lookup fails for methods returning vector types (because of attrib...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: patch, rejects-valid
Depends on: 9844
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-03 04:01 UTC by Timothy J. Wood
Modified: 2004-09-23 18:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 3.4.0 3.3.1 4.0.0
Last reconfirmed: 2004-09-17 00:39:21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy J. Wood 2004-02-03 04:01:34 UTC
#include <altivec.h>

class Constants {
    vector unsigned int _pack0;
public:
    Constants() {
        _pack0 = (vector unsigned int){0xdeadbeef, 0xabababab, 0x55555555, 0x12345678};
    };

    inline vector unsigned int deadbeef(void) const {
        return vec_splat(_pack0, 0);
    };
};

vector unsigned int const_deadbeef(Constants &C)
{
    return C.deadbeef();
}


Fails to build with:

% $PREFIX/bin/g++ -maltivec -c -Wall av.cpp -o av.o
av.cpp: In function `unsigned int __vector__ const_deadbeef(Constants&)':
av.cpp:17: error: no matching function for call to `Constants::deadbeef()'
av.cpp:10: note: candidates are: unsigned int __vector__ Constants::deadbeef(const Constants*)
Comment 1 Andrew Pinski 2004-02-03 04:21:30 UTC
Confirmed, a shorter and self contained testcase, resummarizing as this is target independent:
#define vector __attribute__((vector_size(16)))
struct Constants {
    inline vector unsigned int deadbeef(void) const {
        return (vector unsigned int){0xdeadbeef, 0xabababab, 0x55555555, 0x12345678};
    };
};
vector unsigned int const_deadbeef(Constants &C)
{
    return C.deadbeef();
}
Comment 2 Andrew Pinski 2004-02-03 04:23:20 UTC
I am almost sure that the problem which causes PR 9844 also causes this bug.
Comment 3 Andrew Pinski 2004-06-18 04:15:54 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01467.html>.
Comment 5 Andrew Pinski 2004-09-23 18:26:46 UTC
Fixed.
Comment 6 Andrew Pinski 2004-09-23 18:27:03 UTC
Fixed.