Bug 18743 - could not convert `x' to `const char *&'
could not convert `x' to `const char *&'
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2000-10-09 17:10 EDT by Dan Melchione
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-09 17:12:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
sample source (141 bytes, text/plain)
2000-10-09 17:11 EDT, Dan Melchione
no flags Details

  None (edit)
Description Dan Melchione 2000-10-09 17:10:56 EDT
#include "stdio.h"
void test(const char *&pString) {}
int main(int argc, char* argv[])
    char *x = "test";
    return 0;

returns the error:
test2.cpp: In function `int main (int, char **)':
test2.cpp:6: could not convert `x' to `const char *&'
test2.cpp:2: in passing argument 1 of `test (const char *&)'

kgcc and other compilers work fine.
Comment 1 Dan Melchione 2000-10-09 17:11:57 EDT
Created attachment 3944 [details]
sample source
Comment 2 Jakub Jelinek 2000-10-09 17:37:51 EDT
There is no implicit conversion from char * to const char *&,
this testcase is really invalid.
Like the previous testcase, this is invalid already in g++ 2.95.

Note You need to log in before you can comment on or make changes to this bug.