view gcc/testsuite/g++.dg/template/nontype6.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do compile }
// Origin: <v dot haisman at sh dot cvut dot cz>
// PR c++/13957: Improved error message for type in template (when non-type
//  is expected).

template <class T>
struct A
{
  typedef int type;
};

template <class T>
void func(void)
{
  (void)A<T>::type();	 // { dg-error "non-type" "non-type" }
// { dg-message "if a type" "note" { target *-*-* } .-1 }
}

template void func<float>(void);    // { dg-message "required from here" }