From 748aa9b65364d72b0f9a36139e292eaf3bc86aa4 Mon Sep 17 00:00:00 2001 From: Alok Kumar Sharma Date: Tue, 3 Aug 2021 15:19:00 +0530 Subject: [PATCH] [gdb/testsuite] templates.exp to accept clang++ output Please consider below testcase with intended error. `````````` constexpr const char cstring[] = "Eta"; template class Column {}; using quick = Column; // cstring without '&' void lookup() { quick c1; c1.ls(); } `````````` It produces below error. `````````` no member named 'ls' in 'Column<&cstring, double>'. `````````` Please note that error message contains '&' for cstring, which is absent in actual program. Clang++ does not generate & in such cases and this should also be accepted as correct output. gdb/testsuite/ChangeLog: * gdb.cp/templates.exp: Accept different but correct output from the Clang++ compiled binary also. --- gdb/testsuite/gdb.cp/templates.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 8b905e4254f..388c4f268cc 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -515,6 +515,9 @@ gdb_test_multiple "ptype/r quxint" "ptype quxint" { -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" } + -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { + pass "ptype quxint" + } -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" } -- 2.30.2