[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / cxx0x-constexpr-const.cpp
bloba4398b32a14066b171e6ef25d25cebc04f4cdc0e
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 constexpr int x = 1; // expected-note {{variable 'x' declared const here}}
4 constexpr int id(int x) { return x; }
6 void foo(void) {
7 x = 2; // expected-error {{cannot assign to variable 'x' with const-qualified type 'const int'}}
8 int (*idp)(int) = id;