Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x |
Fariborz Jahanian | 6c813e1 | 2009-10-27 16:51:19 +0000 | [diff] [blame] | 2 | |
Douglas Gregor | 325e593 | 2010-04-15 00:00:53 +0000 | [diff] [blame^] | 3 | struct A { // expected-error {{implicit default constructor for 'A' must explicitly initialize the const member 'i'}} \ |
| 4 | // expected-warning{{struct 'A' does not declare any constructor to initialize its non-modifiable members}} |
| 5 | const int i; // expected-note {{declared at}} \ |
| 6 | // expected-note{{const member 'i' will never be initialized}} |
Fariborz Jahanian | 6f26920 | 2009-11-03 20:38:53 +0000 | [diff] [blame] | 7 | virtual void f() { } |
Fariborz Jahanian | 6c813e1 | 2009-10-27 16:51:19 +0000 | [diff] [blame] | 8 | }; |
| 9 | |
| 10 | int main () { |
Eli Friedman | 80c30da | 2009-11-09 19:20:36 +0000 | [diff] [blame] | 11 | (void)A(); // expected-note {{first required here}} |
Fariborz Jahanian | 6c813e1 | 2009-10-27 16:51:19 +0000 | [diff] [blame] | 12 | } |