Bug 18743

Summary: could not convert `x' to `const char *&'
Product: [Retired] Red Hat Linux Reporter: Dan Melchione <dm.redhat>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-09 21:12:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample source none

Description Dan Melchione 2000-10-09 21:10:56 UTC
#include "stdio.h"
void test(const char *&pString) {}
int main(int argc, char* argv[])
{
    char *x = "test";
    test(x);
    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 21:11:57 UTC
Created attachment 3944 [details]
sample source

Comment 2 Jakub Jelinek 2000-10-09 21:37:51 UTC
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.