2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
|
2011-03-20 16:06:45 +08:00
|
|
|
|
2015-04-11 09:53:13 +08:00
|
|
|
constexpr int x = 1; // expected-note {{variable 'x' declared const here}}
|
2011-03-20 16:06:45 +08:00
|
|
|
constexpr int id(int x) { return x; }
|
|
|
|
|
|
|
|
void foo(void) {
|
2015-04-11 09:53:13 +08:00
|
|
|
x = 2; // expected-error {{cannot assign to variable 'x' with const-qualified type 'const int'}}
|
2011-03-20 16:06:45 +08:00
|
|
|
int (*idp)(int) = id;
|
|
|
|
}
|
|
|
|
|