view gcc/testsuite/g++.dg/template/nontype6.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

// { 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" }