From 434c01aad0b4d972f7af01da48618c24ae3270cc Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 1 Dec 2015 14:41:50 -0500 Subject: [PATCH 18/26] FIXME: start adding example of template --- gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C b/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C index b94e982..6041794 100644 --- a/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C +++ b/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C @@ -558,6 +558,13 @@ void test_functional_casts (int i, float f) { dg-end-multiline-output "" } */ } +template +class example_template +{ +public: + example_template (TYPENAME v); +}; + void test_new (void) { __emit_expression_range (0, ::new base); /* { dg-warning "range" } */ @@ -591,6 +598,12 @@ void test_new (void) { dg-end-multiline-output "" } */ /* TODO: placement new. */ + + __emit_expression_range (0, new example_template (42)); /* { dg-warning "range" } */ +/* { dg-begin-multiline-output "" } + __emit_expression_range (0, new example_template (42)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { dg-end-multiline-output "" } */ } void test_methods () -- 1.8.5.3