Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Anders Carlsson | c7119a8 | 2011-01-20 05:55:43 +0000 | [diff] [blame] | 3 | |
| 4 | struct Base { |
| 5 | virtual void override(); |
| 6 | }; |
| 7 | |
| 8 | struct S : Base { |
Anders Carlsson | 1f3b6fd | 2011-01-16 23:56:42 +0000 | [diff] [blame] | 9 | virtual void final() final; |
| 10 | virtual void override() override; |
Anders Carlsson | aa031fd | 2011-01-20 03:41:12 +0000 | [diff] [blame] | 11 | }; |
| 12 | |
| 13 | struct T { |
| 14 | // virt-specifier-seq is only valid in member-declarators, and a function definition is not a member-declarator. |
Anders Carlsson | c7119a8 | 2011-01-20 05:55:43 +0000 | [diff] [blame] | 15 | // FIXME: This currently doesn't work. |
| 16 | // virtual void f() const override { } |
Anders Carlsson | 1f3b6fd | 2011-01-16 23:56:42 +0000 | [diff] [blame] | 17 | }; |
Anders Carlsson | 37ea6c4 | 2011-01-20 04:07:46 +0000 | [diff] [blame] | 18 | |
| 19 | struct override; |
Anders Carlsson | c7119a8 | 2011-01-20 05:55:43 +0000 | [diff] [blame] | 20 | struct Base2 { |
| 21 | virtual override override(int override); |
| 22 | }; |
| 23 | |
| 24 | struct A : Base2 { |
| 25 | virtual struct override override(int override) override; |
Anders Carlsson | 37ea6c4 | 2011-01-20 04:07:46 +0000 | [diff] [blame] | 26 | }; |