c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / non-dependent23.C
blob885a641a6551a69fc32dde8ea843f1232daa76e0
1 // PR c++/105637
3 struct Base {
4   void foo();                // #1
5   void foo() const;          // #2
6   void foo() volatile;       // #3
7   void foo() const volatile; // #4
8 };
10 template<class T>
11 struct TopClass : T {
12   void failsToCompile() const {
13     Base::foo(); // should select #2, not #1
14   }
16   void failsToCompile() volatile {
17     Base::foo();  // should select #3, not #1
18   }
20   void failsToCompile() const volatile {
21     Base::foo();  // should select #4, not #1
22   }
25 template struct TopClass<Base>;