| 1 |
/* End-to-end test of -fdiagnostics-show-template-tree and -felide-type |
| 2 |
using the STL. |
| 3 |
In particular, ensure that we don't print the default arguments e.g. |
| 4 |
rather than printing |
| 5 |
from 'vector<double,allocator<double>>' to 'vector<float,allocator<float>>' |
| 6 |
(albeit with differences nicely color-coded), we want to print: |
| 7 |
from 'vector<double>' to 'vector<float>' |
| 8 |
(again, with the "double" and "float" highlighted, though we can't test |
| 9 |
for that in this case). */ |
| 10 |
|
| 11 |
// { dg-options "-fdiagnostics-show-template-tree -Wno-return-type" } |
| 12 |
// { dg-skip-if "requires hosted libstdc++ for map" { ! hostedlib } } |
| 13 |
|
| 14 |
#include <map> |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
using std::vector; |
| 18 |
using std::map; |
| 19 |
|
| 20 |
void takes_vf (vector<float> v); |
| 21 |
void takes_mivf (map<int, vector<float> > v); |
| 22 |
|
| 23 |
int test () |
| 24 |
{ |
| 25 |
takes_vf (vector<double> ()); // { dg-error "could not convert '.*' from 'vector<double>' to 'vector<float>'" } |
| 26 |
/* { dg-begin-multiline-output "" } |
| 27 |
vector< |
| 28 |
[double != float]> |
| 29 |
{ dg-end-multiline-output "" } */ |
| 30 |
|
| 31 |
takes_mivf (map<int, vector<double> > ()); // { dg-error "could not convert '.*' from 'map<.\\.\\.\\..,vector<double>>' to 'map<.\\.\\.\\..,vector<float>>'" } |
| 32 |
/* { dg-begin-multiline-output "" } |
| 33 |
map< |
| 34 |
[...], |
| 35 |
vector< |
| 36 |
[double != float]>> |
| 37 |
{ dg-end-multiline-output "" } */ |
| 38 |
} |