Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/warn/Wredundant-tags-3.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/warn/Wredundant-tags-3.C Mon May 25 07:50:57 2020 +0900 @@ -0,0 +1,45 @@ +/* PR c++/93801 - False -Wmismatched-tags upon redundant typename + { dg-do compile } + { dg-options "-Wall -Wredundant-tags" } */ + +namespace N +{ + class C { }; + enum E { }; + struct S { }; + union U { }; + + template <int> class TC { }; + template <int> struct TS { }; + template <int> union TU { }; +} + +N::C c1; +typename N::C c2; // { dg-bogus "-Wredundant-tags" } +class N::C c3; // { dg-warning "-Wredundant-tags" } + +N::E e1; +typename N::E e2; // { dg-bogus "-Wredundant-tags" } +enum N::E e3; // { dg-warning "-Wredundant-tags" } + +N::S s1; +typename N::S s2; // { dg-bogus "-Wredundant-tags" } +struct N::S s3; // { dg-warning "-Wredundant-tags" } + +N::U u1; +typename N::U u2; // { dg-bogus "-Wredundant-tags" } + // { dg-bogus "'class' tag used in naming 'union N::U" "pr93809" { xfail *-*-*} .-1 } +union N::U u3; // { dg-warning "-Wredundant-tags" } + + +typedef N::TC<0> TC0; +typedef typename N::TC<0> TC0; +typedef class N::TC<0> TC0; // { dg-warning "-Wredundant-tags" } + +typedef N::TS<0> TS0; +typedef typename N::TS<0> TS0; +typedef struct N::TS<0> TS0; // { dg-warning "-Wredundant-tags" } + +typedef N::TS<0> TS0; +typedef typename N::TS<0> TS0; +typedef struct N::TS<0> TS0; // { dg-warning "-Wredundant-tags" }