📄 nontype12.c
字号:
// PR c++/20172// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>template<typename T> struct A{ template<T> int foo(); // { dg-error "double" } template<template<T> class> int bar(); // { dg-error "double" } template<T> struct X; // { dg-error "double" }};A<char> a1;A<double> a2; // { dg-error "instantiated" }template<typename T> struct B{ template<double> int foo(); // { dg-error "double" } template<template<double> class> int bar(); // { dg-error "double" } template<double> struct X; // { dg-error "double" }};template<void> int foo(); // { dg-error "void" }template<template<void> class> int bar(); // { dg-error "void" }template<void> struct X; // { dg-error "void" }template<typename T> struct C{ template<T> int foo(); // { dg-error "double" }};template<typename T> int baz(T) { C<T> c; } // { dg-error "instantiated" }void foobar(){ baz(1.2); // { dg-error "instantiated" }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -