]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] templates.exp to accept clang++ output
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Tue, 3 Aug 2021 09:49:00 +0000 (15:19 +0530)
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Tue, 3 Aug 2021 09:50:04 +0000 (15:20 +0530)
Please consider below testcase with intended error.
``````````
    constexpr const char cstring[] = "Eta";
    template <const char*, typename T> class Column {};
    using quick = Column<cstring,double>; // 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

index 8b905e4254fb210e20978f501e007735c14454c3..388c4f268cc8eb2a4b13009d2e57b8fcd52fe13c 100644 (file)
@@ -515,6 +515,9 @@ gdb_test_multiple "ptype/r quxint" "ptype quxint" {
     -re "type = class Qux<int, ?& ?string> \\{\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<int, string> \\{\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<int, ?& ?string> \\{\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"
     }