view gcc/testsuite/g++.dg/template/show-template-tree-3.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* End-to-end test of -fdiagnostics-show-template-tree and -felide-type
   using the STL.
   In particular, ensure that we don't print the default arguments e.g.
   rather than printing
     from 'vector<double,allocator<double>>' to 'vector<float,allocator<float>>'
   (albeit with differences nicely color-coded), we want to print:
     from 'vector<double>' to 'vector<float>'
   (again, with the "double" and "float" highlighted, though we can't test
   for that in this case).  */

// { dg-options "-fdiagnostics-show-template-tree" }
// { dg-additional-options "-Wno-return-type" }

#include <map>
#include <vector>

using std::vector;
using std::map;

void takes_vf (vector<float> v);
void takes_mivf (map<int, vector<float> > v);

int test ()
{
  takes_vf (vector<double> ()); // { dg-error "could not convert '.*' from 'vector<double>' to 'vector<float>'" }
  /* { dg-begin-multiline-output "" }
  vector<
    [double != float]>
     { dg-end-multiline-output "" } */

  takes_mivf (map<int, vector<double> > ()); // { dg-error "could not convert '.*' from 'map<.\\.\\.\\..,vector<double>>' to 'map<.\\.\\.\\..,vector<float>>'" }
  /* { dg-begin-multiline-output "" }
  map<
    [...],
    vector<
      [double != float]>>
     { dg-end-multiline-output "" } */
}